简体   繁体   中英

Can't find specific cause of build path error (Eclipse)

One of my projects in Eclipse has a red exclamation mark next to its name, which I believe indicates a problem with the build path . However, I have triple checked that the paths of all JARs I'm using are valid. In Build Path > Configure Build Path , none of the JARs have red X's next to them.

When I open the 'Problems' window , the only thing listed is "The project cannot be built until build path errors are resolved." This is not very specific, and I do not know how to find the root cause of this problem.

I have rebuilt and refreshed my project many times, which has not fixed the problem. What could be causing this?

(This is a standard eclipse project; I'm not using gradle or maven)

1.Right CLick on your project, Choose Build Path > Configure Build Path 2.Select JRE System Library and click Edit. 3.Choose last Radiobutton option Workspace default JRE and click Finish. 4.Clean and build your project.

It may help.

Also check for targeted runtime if your project is web project. If any server is missing delete it and create new one

Identify in your code if there is any error markings (those red squiggly lines). Looking at the import statements would be good.

  1. If the error markings are on a native java packages (like java.util.list ) you have to add the JRE to the build path.
  2. If the error markings are on other packages (third party stuff like spring,hibernate etc), make sure you have added the jars of those packages to the build path. you may need to download them (and also any dependency jars)

You can see all your code probles in the marker view. Go to menubar->window->show view->other->marker

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM