Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The import cannot be resolved in eclipse [duplicate]

Tags:

java

eclipse

Though I have all my source in proper packages.It couldn't find at the time of Building Project.Normally it shows links everything.But at the time of Build Project or Autobuild while directly running project.

The import ecnet.rd.config cannot be resolved  

like it shows for all the internal imports.But external imports like imports from JAR files are working.

P.S :

My Eclipse latestly crashed but it was working well after that, Once again this kind of things are happening.

Please help to find the way to solve this.

like image 217
sunleo Avatar asked Feb 03 '14 12:02

sunleo


People also ask

What is the error of Cannot be resolved to a type?

This means that your project isn't setup to include the JUnit libraries when it compiles; JUnit is not included in the Java runtime libraries (JRE System Library) so you have to add it to the build path.

Can not be resolved Eclipse?

Solution: In Eclipse, the cause of this problem is that somehow the SYSTEM JRE LIBRARY associated with the project was deleted. Simple fix in Eclipse: Right Click Project you are working on from Package Explorer.


2 Answers

In my experience, it is usual with Eclipse to have the build messed up. Make sure Build automatically is checked and Clean. If it doesn't work, restart Eclipse and do again.

Also as Tech Junkie comments below, try also Clean all projects.

like image 78
m0skit0 Avatar answered Oct 09 '22 08:10

m0skit0


I've seen this happen and another approach to take which is similar to m0skit0 solution (if you are using Eclipse) is to right click on the project, select maven, select update project, make sure clean projects and refresh workspace are checked, and hit ok.

like image 43
George Avatar answered Oct 09 '22 08:10

George