Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 649
tb189 Avatar asked Jul 29 '11 09:07

tb189


1 Answers

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.
like image 110
gotomanners Avatar answered Nov 10 '22 11:11

gotomanners