Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse/Java newbie: package not found now, but it was yesterday

I'll be involved in Java development for the first time. The application will be built on an set of Eclipse plug-ins and packages called UDOP. This set comes with tutorials, which I'm going through.

Yesterday things were fine, and in my example code I was able to import a certain package, and extend one of the classes it contains. When I started Eclipse today, a package in an import statement has a red line under it, with a hover-message telling me that the import cannot be resolved. The target platform is correct, and my dependencies match what the tutorial wants. I've run Update Classpath.

Details:

  1. the import statement is

    import com.tdkc.udop.extensionpoints.views.ViewPartBase;
    
  2. The red squiggly line is under com.tdkc.udop.extensionpoints.

  3. com.tdkc.udop is set as a dependency.

  4. The Target Platform is .../UDOP_SDK,

  5. and under that I can find the file .../UDOP_SDK/plugins/com.tdkc.udop_1.7.0/com/tdkc/udop/extensionpoints/views/ViewPartBase.class

  6. com.tdkc.udop appears in the Package Explorer, and from within the P.E. I can navigate down and see ViewBasePart.class.

Although I'm new at Eclipse and Java, I do have moderate experience with c++ and Objective-C and Cocoa.

What are possible causes for an import not to be found? What should I check? Thanks.

like image 376
garyp Avatar asked Aug 14 '12 15:08

garyp


1 Answers

If nothing has changed since the last time everything was peachy, it might just be a matter of doing a Project -> Clean and then selecting Clean all projects like so:

enter image description here

Finally, click on OK and Eclipse should clean out all the projects and build everything.

like image 136
Ashutosh Jindal Avatar answered Dec 04 '22 15:12

Ashutosh Jindal