Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 574242

Summary: maven compile failed - class file has wrong version 55.0, should be 52.0
Product: [Eclipse Project] JDT Reporter: Franck Demeyer <franck.demeyer>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: critical    
Priority: P3 CC: loskutov
Version: 3.8.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Franck Demeyer CLA 2021-06-16 11:29:05 EDT
Hi,
since a few days an error occurs when compiling a project which use org.eclipse.jdt.core (version 3.12.2): 


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project code-formatter: Compilation failure
[ERROR] /tools/code/formatter/Formatter.java:[9,30] cannot access org.eclipse.jface.text.BadLocationException
[ERROR]   bad class file: /home/fdemeyer/.m2/repository/org/eclipse/platform/org.eclipse.text/3.12.0/org.eclipse.text-3.12.0.jar(org/eclipse/jface/text/BadLocationException.class)
[ERROR]     class file has wrong version 55.0, should be 52.0
[ERROR]     Please remove or make sure it appears in the correct subdirectory of the classpath.


Intern dependencies are ranged from version 3.1.0 to version 4.0.0.
Reading their's MANIFEST's it seems that last versions of org.eclipse.text (3.12.0) and org.eclipse.core.runtime (3.22.0) dependencies (at least) were compile with Java 11, when previous versions were compile with java 7, which induces an incompatibility with project build in java version lower than 11.
Comment 1 Andrey Loskutov CLA 2021-06-16 11:32:41 EDT
The dependencies of your project are requiring Java 11. How can Eclipse project help you here? Make sure your target is properly defined and doesn't refer recent Eclipse libraries that are requiring Java 11.
Comment 2 Franck Demeyer CLA 2021-06-17 06:12:06 EDT
(In reply to Andrey Loskutov from comment #1)
> The dependencies of your project are requiring Java 11. How can Eclipse
> project help you here? Make sure your target is properly defined and doesn't
> refer recent Eclipse libraries that are requiring Java 11.

The project runs with java 8, and initially that dependency works well.
But since last modifications it fails.
I hope you can compile transitive dependencies with java 7 or 8.
Thx
Comment 3 Andrey Loskutov CLA 2021-06-17 06:18:27 EDT
(In reply to Franck Demeyer from comment #2)
> The project runs with java 8, and initially that dependency works well.
> But since last modifications it fails.
> I hope you can compile transitive dependencies with java 7 or 8.

This is a bug tracker, not a help/support forum.
Managing dependencies of your project is not an Eclipse bug, it is your job.
Please don't update dependencies or switch to Java 9+.
Comment 4 Franck Demeyer CLA 2021-06-17 08:16:57 EDT
(In reply to Andrey Loskutov from comment #3)
> (In reply to Franck Demeyer from comment #2)
> > The project runs with java 8, and initially that dependency works well.
> > But since last modifications it fails.
> > I hope you can compile transitive dependencies with java 7 or 8.
> 
> This is a bug tracker, not a help/support forum.
> Managing dependencies of your project is not an Eclipse bug, it is your job.
> Please don't update dependencies or switch to Java 9+.

I'm aware that it's not a help/support forum.

From my point of view it's typically a bug, inner dependencies versions MUST NOT imply breaking change wich is the case by changing their build jdk.

Only one dependency, org.eclipse.jdt.core, is present in this part of the project and has not been updated since march 2017.