Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse "this compilation unit is not on the build path of a java project"

I can't get autocompletion to work in Eclipse.

I'm working on the project on svn. I set up the project in Eclipse by going into

File -> Import -> Checkout As a Project -> New Project Wizard.

I chose Enterprise Java Application. Everything seemed to work fine except instead of autocompletion working as I expected I got a popup dialog displaying the message

This compilation unit is not on the build path of a java project.

I've Googled it and everyone says that the project must be a Java project, but it is! What is the problem?

Update

The catalog structure on svn looks like this:

-Project_name   -application      -META-INF        application.xml        MANIFEST.MF   +build   +db   +deploy   +dist   +lib   +properties   +script   -src      -META-INF         someother.xml (datasource info)         persistence.xml         folder hierarchy with source files (should be package)   -web      some folders           .           .      files        .        .      -WEB-INF         faces-config.xml         jboss-web.xml         web.xml      build_win.xml 

How do I tell Eclipse where the source files folder, application.xml, and other configuration xml files are?

like image 440
l245c4l Avatar asked Feb 05 '10 10:02

l245c4l


People also ask

How do I add missing build path entries in Eclipse?

Right-click on the project and choose properties. Click on the Java Build Path option in the left side menu. From the Java Build Path window, click on the Libraries Tab. Make sure JRE System library is listed, if it is not listed then you can add, by clicking "Add Library" from the right side menu.

Where is my project path in Eclipse?

Use Alt+Enter on the project Name in Eclipse to see the complete path of the project directory where it resides.


1 Answers

When you have a multimodules maven project under a parent project, make sure you're not editing the file in the maven parent project.

like image 54
redochka Avatar answered Sep 23 '22 13:09

redochka