redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.07k stars 433 forks source link

Suspect warning about incompatible .class files version in required binaries #3699

Open oliviercailloux opened 2 months ago

oliviercailloux commented 2 months ago

When I add logback 1.5.6 as a dependency in my POM, vscode tells me: “Incompatible .class files version in required binaries. Project 'simple' is targeting a 17 runtime, but is compiled against '(…)/.m2/repository/ch/qos/logback/logback-core/1.5.6/logback-core-1.5.6.jar' (from the container 'Maven Dependencies') which requires a 21 runtime”.

I believe that the warning is incorrect: extracting the content of .m2/repository/ch/qos/logback/logback-core/1.5.6/logback-core-1.5.6.jar and running javap -verbose on a few classes reveal a major version equal to 55.

The JAR is a multi-release one, including some classes specific to Java 21. I suspect that this confuses vscode.

Environment

Steps To Reproduce

Add logback 1.5.6 as a dependency in your POM.

Here is a sample project.

Logs (partial and redacted): messages, server.

Current Result

Warning

Expected Result

No warning

Additional Informations