user3871
user3871

Reputation: 12718

Eclipse random unknown type/resolving errors

I opened up Eclipse after some time to check code for an old project. Each of my projects now have a red exclamation mark and getting error such as unresolveable and unknown data types for those imported libraries (ex: Timer, Queue, etc).

enter image description here

I haven't touched Eclipse in months, so I'm not sure what happened.


enter image description here

Upvotes: 1

Views: 1265

Answers (3)

user4058999
user4058999

Reputation:

Click on properties on your project context menu:

http://puu.sh/gqlBu.png

Find out which library is missing:

http://puu.sh/gqlxm.png

You can update the library's location by double-clicking on it.

Upvotes: 1

M A
M A

Reputation: 72864

java.util.Timer is part of the JRE library. If Eclipse is unable to find it, this means that the JRE system library is not being found by Eclipse.

You can view the dependency on the JRE library by right-clicking on the project and choosing Properties -> Java Build Path. In the Libraries tab there should be an entry for the JRE system library. Make sure that this is pointing to a valid JRE on your system.

If the JRE is marked unbound, check that a JRE1.6 is installed in the preferences under Window -> Preferences -> Java -> Installed JREs.

enter image description here

Upvotes: 1

Lawrence Aiello
Lawrence Aiello

Reputation: 4638

That means Eclipse cannot find the .jar files that those libraries were inside, and now have no idea where to import them from.

To fix:

  1. Right click your project and select "Properties".
  2. Click on "Java Build Path".
  3. Click the "Libraries" tab.
  4. Check your .jar files. It is most likely that there will be red lines under them saying "missing". Download the .jar files from the internet, and place them into a folder on your machine.
  5. Click "Add External JARs" and route Eclipse to this new folder

Upvotes: 2

Related Questions