Why does my eclipse project not have a build path?

人盡茶涼 提交于 2019-12-21 04:24:05

问题


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.

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


回答1:


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.




回答2:


Nothing above solutions worked for me so i tried below

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




回答3:


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)"




回答4:


I tried below steps and it works for me.

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




回答5:


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).




回答6:


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

vs.




回答7:


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.




回答8:


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

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




回答9:


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.



来源:https://stackoverflow.com/questions/11234399/why-does-my-eclipse-project-not-have-a-build-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!