redhat-developer / redhat-developer/vscode-java
Spurious warning about incompatible .class files version in required binaries
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 2.3k
- フォーク
- 547
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 11
説明
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
- Operating System: linux
- JDK version: 17
- Visual Studio Code version: 1.91.0
- Java extension version: v0.27.0
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
mvn compiledoes not complain.- Might be related to #3319.
- I posted an issue to logback before realizing that the problem seems to come from vscode.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされた Simple sample project、その POM、および添付された messages/server logs から始め、JDK 17 と logback 1.5.6 で再現し、multi-release JAR entries の処理を調査します。完了条件は、Maven が引き続き正常にコンパイルできる一方で、サンプルが incompatible class-file warning を報告しなくなることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, typescript
- 領域
- developer-experience, devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100