-1

I am again at the point where I believe my uni wants to freak me out. My uni just threw this eclipse project at me and I am supposed to run it as a java application. My uni says this is trivial but for me it is not!

So here it goes: They gave me a zip archive and I imported it by Import Existing Projects into Workspace and then selecting the zip archive. It all went well, however, I am not able to run it as a Java application. Also, I noted that the folder JRE System Library was missing.

Can someone explain me what this all means and how I can solve this problem? My uni did feel like explaining a lot...

Kara
  • 6,115
  • 16
  • 50
  • 57
user2426316
  • 7,131
  • 20
  • 52
  • 83

3 Answers3

1

A simple solution if you have recent eclipse :

  1. Right click the project
  2. select "configure"
  3. "Convert to faceted form"
  4. Select "Java" facet
  5. Click OK
C.Champagne
  • 5,381
  • 2
  • 23
  • 35
  • This worked for me. It was not showing any options when I did "Rigjht cick" -> "Build Path" -> It says "No options available" But with the above steps in the answer, it worked! – Sachin Ramdhan Boob Aug 06 '20 at 09:09
0

Right-click the project, and select properties. On the build path menu, add the system library->JRE.

You can then try to run the project as follows: Click the dropdown arrow next to the run button, and pick run configurations. On the left, add a new configuration, and select its project to be the project you imported. Also select the main class accordingly. You can now run this configuration and it should run the project.

Edit: This may not work depending on the configuration.

nanofarad
  • 40,330
  • 4
  • 86
  • 117
  • I don't have those options in my properties. I only have `Resource`, `Builders`, `Project References` and `Run / Debug Settings` – user2426316 Jul 01 '13 at 13:39
  • @user2426316 Make sure the java perspective is installed and active. Also try expanding each of these categories to find it. – nanofarad Jul 01 '13 at 13:41
  • This is a duplicate, see my comment to find them and their answers – C.Champagne Jul 01 '13 at 13:44
  • how can I check that my java perspective is installed? – user2426316 Jul 01 '13 at 13:45
  • @hexafraction Your solution doesn't work even if you have java perspective intalled. Just test it. – C.Champagne Jul 01 '13 at 13:45
  • 1
    Wow, here I am again, nobody is able to explain me what is going on and how I can solve my problem... Did you even read my question? – user2426316 Jul 01 '13 at 13:47
  • @user2426316 is the title of your question correct? By reading it and the content of the question I understand the project you imported is not a java project. I have posted an answer to solve it (if you have a recent version of Eclipse) and I mentioned the URL of the questions which I consider as duplicates. – C.Champagne Jul 01 '13 at 14:30
  • @C.Champagne That can't be right... I've used this in Juno previously. – nanofarad Jul 01 '13 at 14:58
  • @hexafraction I did the test 1h ago with juno too. Try create a projet, not a java project, right-click and select build path, you will see you cannot add any reference because it is not a Java project. – C.Champagne Jul 01 '13 at 15:06
0

unzip the file first and try import again maybe

fe3o4
  • 59
  • 1
  • 9