开发者

Eclipse missing already imported required project

I have 3 java projects in eclipse (A, B, C), where C is a required project for both A and B. Each time I start eclipse, I get the error

 Project 'A' is missing required Java project: 'C'
 Project 'B' is missing required Java project: 'C'

When I remove project C from the build path of A or B, and add it again, the error disappears. The errors ... cannot be resolved to a type only appear when I remove project C from the build path, and F3-ing to source files in project C from project A or B works, implying that it does find the correct source files.

My .classpath file looks like this:

<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JCIFS"/>
    <classpathentry combineaccessrules="false" kind="src" path="/C"/>
    <classpathentry kind="开发者_开发知识库output" path="bin"/>
</classpath>

My eclipse version is Galileo, plug-ins: Subclipse, CDT (so no Maven). Build automatically is checked.

Anybody know how I can avoid re-adding the project every time I start eclipse?


Try this:

  • Right click on your project name (A or B) and select properties...
  • Select Java Build Path and the Projects tab, check project C as a required project on each of A and B.
  • Select the "Project References" option and check project C as a project reference on each of A and B.
  • Clean and rebuild just for the craic!
  • Make sure Project C is not closed when eclipse is restarted.


I've seen this too, and on several occasions though with no clear pattern. I believe it is a bug in Eclipse.

Sometime closing & re-opening project A fixes it. Sometimes I have to delete & re-install Eclipse to fix it.


Have you simply tried to clean your workspace and do a full build?


This error typically happens if the project is closed. But you would get the error as soon as you close C - that is, long before you restart Eclipse.

It's quite hard to say what could cause this. Mabye it's an old bug but I don't remember anything specifically in 3.5 / Galileo.

Try these things:

  1. "Clean..." and select all projects. Does that help?
  2. When you get the error, did Eclipse succeed or fail to build C?
  3. Is that a Java or C/C++ project? Maybe it's a bug in CDT.
  4. Try with Eclipse 3.7. It's pretty compatible with 3.5 but many bugs were fixed. Maybe that fixes your issue, too. Export your prefs, unpack 3.7 somewhere (leave 3.5 alone), import prefs. If you want to be 100% sure, create a second workspace.


I just had this too, and I think it was because of a resource filter. I was trying to hide .class files from the open resource dialogue. To fix this problem, I removed my resource filter and cleaned the projects - now it seems to be behaving well.


This looks like a windows path names problem. Why do yo name your projects A, B, C and dont give them proper names isntead?

<classpathentry combineaccessrules="false" kind="src" path="/C"/>

I would bet that /C is interpreted errornously as a drive letter, hence your problems.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜