Java: unresolved compilation issue

What are the possible causes of java.lang.Error: Unresolved compilation problem?

Additional Information:

I saw this after copying a set of updated JAR files from the assembly on top of the existing JARs and restarting the application. JARs are created using the Maven build process.

I would expect to see LinkageErrors or ClassNotFound errors if the interfaces have changed. The above error indicates a lower level problem.

A clean rebuild and redistribution fixed the problem. Can this error indicate a damaged JAR?

+54
java
Jul 14 '09 at 11:25
source share
7 answers

(rewritten 2015-07-28)

The default behavior of Eclipse when compiling code with errors in it is to generate byte code that throws the exception you see. This is possible because Eclipse uses its own built-in compiler instead of javac from the JDK, which uses Apache Maven. If you use Eclipse in a Maven project, with which you also work with the mvn command line mvn , this can happen.

Correction - Correct errors and recompile before restarting.

The parameter is marked with a red field for this screendump:

Eclipse Settings for OS X

+53
Jul 14 '09 at 11:29
source share

try to clear the eclipse project

+11
Apr 16 2018-12-12T00:
source share

Compiled classes can be recompiled from the source with new banks.

Try running "mvn clean" and then rebuild

+6
Aug 18 '10 at 4:10
source share

you are just trying to clear maven with command

 mvn clean 

and after that the next command

 mvn eclipse:clean eclipse:eclipse 

and rebuild your project ....

+3
Sep 02 '13 at 11:05 on
source share

I had this error when I used a startup configuration that had an invalid class path. In my case, I had a project that originally used Maven, and thus, in the startup configuration there was a Mpath element of the Maven class. Later, I changed the project to using Gradle and removed the Maven class path from the project class path, but the launch configuration still used it. I got this error while trying to run it. Project cleanup and restoration did not resolve this error. Instead, edit the startup configuration, delete the project class path element, and then add the project back to the user entries in the class path.

+1
Mar 24 '15 at 0:12
source share

I got this error several times and tried my best to work. Finally, I deleted the launch configuration and added the default entries again. It worked beautifully.

+1
Apr 30 '15 at 2:25
source share

The main part correctly answered Thorbjorn Ravn Andersen.

This answer attempts to shed light on the remaining question: how can a class file with errors get into the bank?

Each assembly (mvn & javac or eclipse) signals in its specific way when it gets into a compilation error and refuses to create a Jar file (or at least warn you). The most likely reason for silently receiving class files with errors in the bank is the simultaneous operation of Maven and Eclipse.

If you have Eclipse open when you run the mvn build, you must disable Project > Automatically create until mvn completes.

0
May 02 '15 at 19:57
source share



All Articles