简体   繁体   中英

Error in Eclipse: “The project cannot be built until build path errors are resolved”

I am a computer science student learning Java, so I do some work at home and at college on a mixture of Linux and Windows. I have a problem after copying a new project into the Eclipse workspace. The project shows up, but with a red exclamation mark and an error saying:

The project cannot be built until build path errors are resolved

How can I fix this? I tried the solution described here , but it didn't work.

  1. Identify "project navigator" or "package explorer" view.
    Right click on your project, select Build Path --> Configure build Path .

  2. In the emerging window, you will find four tabs, select "Libraries" .There, under "Web app libraries" (expand it), you will see the libraries added to the project's classpath. Check if all of them are available. If one or more are not (they'll have "missing" beside their name and a red mark on their icon), check if you need them (perhaps you don't); if you don't need them, remove it, if you need them, exit this window, look out for the missing jar and IMPORT it into your project.

  1. Open the Problems view. You can open this view by clicking on the small + sign at the left hand bottom corner of eclipse. It's a very tiny plus with a rectangle around it. Click on it and select problems.

  2. The problem view will show you the problems that need to be resolved.

    • If the message says "the project is missing the required libraries...", you need to configure your build path by right clicking on your project, selecting properties, then build path. Add the required jar files using the libraries tab. -If there are other problems other than missing libraries, you need to post the exact problems here to get a precise solution.

如果您找不到构建路径错误,有时菜单ProjectClean...就像一个魅力。

In my case, all libraries in the build path were OK.

To solve it, I deleted all project metadata (.project, .classpath, .settings) and re-imported the project as a Maven project.

I also had this problem in my system, but after looking inside the project I saw the XML structure of the .classpath file in the project path was incorrect. After amending that file the problem was solved.

If not working in any case...then delete your project from the Eclipse workspace and again import as a Maven project if that is a Maven project. Else import as an existing project.

I tried all the previous given solutions, but they didn't work, but it works for me.

  1. Right click your Project > Properties > Java Build Path > Libraries

  2. Remove the file with red "X" (something like JRE...)

  3. Add Library

That's how I solved my problem.

In Eclipse, go to Build Path, click "Add Library", select JRE System Library, click "Next", select option "Workspace default JRE(i)", and click "Finish".

This worked for me.

  1. Go to Project > Properties > Java Compiler > Building
  2. Look under Build Path Problems
  3. Un-check "Abort build when build path error occurs"
    It won't solve all your errors but at least it will let you run your program :)

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