16

What is the advantage with not having a build path in eclipse? Why is that setting default when it's like something you'd never use? It seems eclipse indigo was developed to make software development as obscure as possible. I just checked out a fresh copy of the project I checked in (called dungeonworld) this afternoon from another computer and automatically nothing works, can't compile, can't choose build path, can't add jre, can't add jdk, can't add that to project properties.

enter image description here

Is my eclipse broken? I can't believe this is happening, such an easy thing not feasible.

Konstantin Komissarchik
  • 28,879
  • 6
  • 61
  • 61
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424
  • 6
    I want to vote it up because "Where is the Eclipse Build Path Setting?" WOULD be a good quuestion, and that's the answer you got. On the other hand, I want to vote this down because this isn't the place to vent or complain about specific products. – David Jun 27 '12 at 20:40
  • Similar issue answered in below post https://stackoverflow.com/a/59519099/7434392 – Kunal Dec 29 '19 at 11:50
  • Make sure you are checking under Package Explorer panel and not under Navigator. – Mahendra May 17 '20 at 15:34

11 Answers11

47

Nothing above solutions worked for me so i tried below

Right click on project >> properties >> project facets >> click on java

enter image description here

Amey Jadiye
  • 3,066
  • 3
  • 25
  • 38
  • If you have a Gradle projet, after setting the java facet, you might need to right click on your project name in the Project Explorer go to `Configure` and select `Add Gradle Nature`. Then you will have the `Gradle` menu item when you right click again on your project. – Pierre C Dec 21 '20 at 15:53
16

It looks like you did not add Eclipse project metadata files to your source control system, so Eclipse doesn't know what your build path is or whether it is even a java project. You can see that the little folder on your dungeonworld project is missing the little 'j', which means Eclipse doesn't think it's a java project.

Go back to your other computer and look for the following files in your original project root...

  1. .project
  2. .classpath
  3. .settings/*

Make sure all of the end up in your source control system or nothing will work right.

Konstantin Komissarchik
  • 28,879
  • 6
  • 61
  • 61
  • So that's why! I actually removed these files and had them versioned to begin with but I removed them since somebody told me that I shouldn't version the .settings file. Appearantly I was misinformed. I'm back now at my other computer to fic this and will report again how progress goes. Thanks a lot for the help. – Niklas Rosencrantz Jun 28 '12 at 12:33
  • 1
    I think this solution is not a good one at this time. It's not a good practice to commit IDE related files into source control. What if someone in team uses different IDE? New versions on eclipse takes care of this automatically. Probably by observing what kind of source and build files you have in your project. – nir Mar 13 '18 at 19:52
  • This is not a good solution for those like me having this issue with someone else's project. Should I create those files myself? – dustytrash Jan 14 '21 at 00:40
5

I have same problem, but i have solved

project right click -> properties -> java build path -> src/main/sources

all remove items on "Excluded", and then that item turn the status "(None)"

Daniel kei
  • 69
  • 1
  • 5
3

I tried below steps and it works for me.

Right click on project >> properties >> project facets >> click on java

  • I haven't any experience with Eclipse, but just to make sure your question will be helpful: is it just click, or one should type some path afterwards? – YakovL Aug 10 '16 at 15:40
  • I had to enable project facets. Then a list opened and Java was checked already. After applying this change, I could run the project and the src folder worked properly. – SPRBRN Apr 11 '17 at 12:57
2

Eclipse has a build path. It's stored in a (by default hidden) .classpath file in your project. You can also access it through the UI in project properties (right click on your project, properties, java build path).

ptyx
  • 4,074
  • 1
  • 19
  • 21
2

Well, this is probably not your problem, but similar is happening if you are in Eclipse different perspective (for example for Python).

enter image description here

vs.

enter image description here

Babu
  • 4,324
  • 6
  • 41
  • 60
1

There where no entrys after right click on my projekt in Eclipse. How to click something, wenn build path entries are missing. So my Eclpise didn't detect my java project. I used following Maven command and after that I cleaned the project too. Now Projekt works as expected. So...

If you are using Maven, try mvn eclipse:eclipse in cmd console in your project directory! Make sure to use the path to your Maven folder for the command.

For example:

cd C:\yourEclipseProject\

C:\yourPathToMaven\apache-maven-2.2.1\bin\mvn eclipse:eclipse

This was helping me. After unsuccessful web research, a coworker told me this tip.

GF. Service
  • 108
  • 1
  • 8
1

I just had a similar problem and I figured out that I had been choosing General Project instead of Java Project while creating a project. After I chose Java>Project it solved my problem. Maybe it'll solve yours as well.

After choosing that, eclipse automatically included java libraries as well.

0

It's not a good practice to commit IDE related files into source control. What if someone in team uses different IDE? It might have been only option at a time when OP asked this question.

New versions on eclipse (4.x) takes care of this automatically. Probably by observing what kind of source and build files you have in your project.

nir
  • 3,743
  • 4
  • 39
  • 63
0

I had the same issue but it turned out was I accidentally closed the Package Explorer and was looking at the Navigator (Deprecated) menu instead. If you close your Package Explorer you can bring it back from

Window -> Show View -> Package Explorer

From the Package Explorer menu, after right-clicking on a project, I can now see the Build Path option, whereas if you right-click on a project in the Navigator menu, you don't see the Build Path option. I guess this is more of an amateur error.

-1

Don't know the reason. But this works for me, so posting it.

Right click on project -> 'Properties' -> 'Java Build Path'.

enter image description here

enter image description here

monkSinha
  • 341
  • 3
  • 10