redhat-developer / redhat-developer/vscode-java
Spurious warning about incompatible .class files version in required binaries
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.3k
- Fork
- 546
- Merge trung bình
- 20 giờ 1 phút
- Pull request đã merge (30 ngày)
- 11
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với Simple sample project được liên kết, POM của nó và các messages/server logs đính kèm; tái hiện trên JDK 17 với logback 1.5.6 và kiểm tra cách xử lý các multi-release JAR entries. Được xem là hoàn tất khi sample không còn báo cảnh báo về incompatible class-file trong khi Maven vẫn biên dịch thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java, typescript
- Lĩnh vực
- developer-experience, devtools
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 38/100