[eclipse] The project cannot be built until the build path errors are resolved.

While compiling an android project in eclipse 3.4.2, I am getting The project cannot be built until the build path errors are resolved.

I got a temporary solution from the blog http://www.scottdstrader.com/blog/ether_archives/000921.html

The resolution was to force a resave of the selected projects (and their .classpath files):

  1. Open the project properties
  2. Select Java Build Path > Libraries
  3. Add a new, arbitrary library (to be deleted later) > OK
  4. Wait for the workspace to refresh (or force a refresh of the project)
  5. The error(s) will go away
  6. Remove the dummy library

The only other references I could find were to make minor alterations of contents of the .classpath file.

Is there any permanent fix for this issue?

This question is related to eclipse build compilation

The answer is


None of the other answers worked for me. Even after fixing my build path issues, doing a refresh, clean, rebuild, and restart (of both eclipse and the computer), I was still getting the little red exclamation point.

I fixed it by closing the project (right-click, close project) and reopening it (double-click the closed project), which seemed to force eclipse to "notice" that the build path problems had been corrected.


Added below to pom.xml file and it worked eventually: 

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>4.0.0</version>
    <scope>provided</scope>
</dependency>

This works for me: close the project then re-open it, this will force eclipse to see it as a fresh project and detects a correct build path.


get a cmd and run

mvn eclipse:eclipse


Goto to Project=>Build Automatically . Make sure it is ticked


I've faced this issue a couple of times and following the below steps has resolved both the times. 1. Navigate to C:\Users\ 2. locate the ".m2" folder and delete it.

  1. Now navigate to the particular project in eclipse and Right-click on the project > Maven > Update Project

wait until the project is updated and in my case following the above steps resolved both the times.


This what fixed it for me...

I was having an issue with my spring-core.jar. I deleted the entire release directory located here. (I'm on win 10).

C:\Users********.m2\repository\org\springframework\spring-core\4.3.1.RELEASE

I right clicked on the project > Maven > Update project and my exclamation mark disappeared. No problems any more.

Here is the source where I found the information:

http://crunchify.com/cannot-be-read-or-is-not-a-valid-zip-file-how-to-fix-maven-build-path-error-with-corrupted-jar-file/


This is what worked for me:

  1. Go to ~/.m2/repository and deleted everything there by running rm -rf. Make sure everything is deleted.
  2. Re-launch eclipse or STS
  3. Right click on project -> Maven -> update project.

On my Mac this is what worked for me

  1. Project > Clean (errors and warnings will remain or increase after this)
  2. Close Eclipse
  3. Reopen Eclipse (errors show momentarily and then disappear, warnings remain)

You are good to go and can now run your project


I ran into this annoying issue with the Play framework. It would be nice if there was some way of knowing what build errors Eclipse is unhappy about, but it's not going to tell you. With one project, I was able to close the project, rebuild the Eclipse configuration with sbt eclipse, and reopen. With an almost identical project, that didn't work. But deleting the project, rebuilding the Eclipse configuration with sbt eclipse, and importing, did the trick.


1-Right CLick on your project folder, Choose Build Path > Configure Build Path
2-Select Libraries Tab and delete any arbitrary library present there.
3-Click on Add Library option, Select JRE System Library and click Next.
4-Choose last Radiobutton option Workspace default JRE and click Finish.
5-press f5 for refresh.
6-run ur program .

Go to > Right CLick on your project folder > Build Path > Configure Build Path > Libraries Tab > remove project and external dependencies > apply & close

Now, Gradle refresh your project.


For my mac osx Eclipse, I followed following steps:

  1. Right CLick on your project, Choose Build Path > Configure Build Path
  2. Select Libraries Tab and delete any arbitrary library or anything else causing errors in Build Path.
  3. Click on Add Library button, Select JRE System Library and click Next.
  4. Choose last Radiobutton option Workspace default JRE and click Finish.
  5. Clean and build your project.

just check if any unnecessary Jars are added in your library or not. if yes, then simply remove that jars from your library and clean your project once. Its worked for me.


If you think you've done everything correctly but Eclipse still complains about the jars, refresh the folder where the jars are and make sure eclipse knows they've been added to the project. Specifying the file path alone is (apparently) not enough


I was getting an additional warning

The compiler compliance specified is 1.6 but a JRE 1.8 is used

Resolving this warning make the error also go away. The steps are as follows:

I right-clicked on it, then clicked on Quick Fix. From the dialog that opened I selected Open the Compiler Compliance property page, and clicked the Finish button.

(This is same as Java Compiler section.)

In this dialog I found the Compiler compliance level drop down and changed 1.6 to 1.8, and clicked on Apply and close.

I got a message box Compiler Settings Changed which asked if I wanted to Build the project now?. I clicked on Yes.

The build path error went away.


In Eclipse this worked for me: right click project. -> Properties -> Library Section; Add (any library at all) -> select library and click remove -> press okay.


This happens when libraries added to the project doesn't have the correct path.

  1. Right click on your project (from package explorer)
  2. Got build path -> configure build path
  3. Select the libraries tab
  4. Fix the path error (give the correct path) by editing jars or classes at fault

I've seen this problem a few times (got it again right now on my home computer with Eclipse 4.2).

Forcing a resave (by changing the classpath e.g. by adding a library, save, change-back) works temporarily. But the problem comes back when Eclipse is restarted :(

Nuking the Eclipse workspace from orbit will permanently fix it (until next time). But there must be a better way!


Examples related to eclipse

How do I get the command-line for an Eclipse run configuration? My eclipse won't open, i download the bundle pack it keeps saying error log strange error in my Animation Drawable How to uninstall Eclipse? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Class has been compiled by a more recent version of the Java Environment Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9 "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat

Examples related to build

error: This is probably not a problem with npm. There is likely additional logging output above Module not found: Error: Can't resolve 'core-js/es6' WARNING in budgets, maximum exceeded for initial How can I change the app display name build with Flutter? Error - Android resource linking failed (AAPT2 27.0.3 Daemon #0) Still getting warning : Configuration 'compile' is obsolete and has been replaced with 'implementation' Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details Component is part of the declaration of 2 modules Maven build Compilation error : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Maven

Examples related to compilation

WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()' How to enable C++17 compiling in Visual Studio? How can I use/create dynamic template to compile dynamic Component with Angular 2.0? Microsoft Visual C++ Compiler for Python 3.4 C compile : collect2: error: ld returned 1 exit status Error:java: invalid source release: 8 in Intellij. What does it mean? Eclipse won't compile/run java file IntelliJ IDEA 13 uses Java 1.5 despite setting to 1.7 OPTION (RECOMPILE) is Always Faster; Why? (.text+0x20): undefined reference to `main' and undefined reference to function