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

Bug 540034

Summary: JDT creates class files with version 55 (JDK 11) even if project compliance set to 1.8
Product: [Eclipse Project] JDT Reporter: Julien HENRY <julien.henry>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: jarthana, register.eclipse
Version: 4.9   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Julien HENRY CLA 2018-10-11 04:56:50 EDT
I'm starting Eclipse (2018-09 + JDK 11 patch from the marketplace) with JDK 11.
> -vm
> /usr/java/jdk-11/bin

I have also configured a JDK 8 in preferences/installed JREs.

I have a simple Maven project with compliance level set to 1.8.

But the resulting .class file has a class file major version 55. I would expect 1.8 projects to produce .class files with the 1.8 class file version (52).

Am I doing something wrong, or is it a bug?
Comment 1 Till Brychcy CLA 2018-10-11 06:50:35 EDT
Shouldn't happen.

Otherwise Can you provide an example project?

Otherwise, can you reproduce this without maven?

Is this true for all .class files in the project or only for some specific ones?

Are you sure the project compliance is 1.8 - in the project properties, not only in the pom.xml. if not, make sure project settings are up-to-date (right-click on the project and choose "Maven > Update Project...")
Comment 2 Julien HENRY CLA 2018-10-11 08:12:01 EDT
My bad, after looking at .class content with javap, I see that the class file major version is correct.

The "Unsupported class file major version 55" error I was facing is due to our plugin to rely on the Eclipse runtime JDK to resolve types like java.lang.Object, while it should use the JDK from the project classpath.

Sorry for the noise.