| 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: | Core | Assignee: | 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: | |||
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...") 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. |
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?