microsoft / microsoft/vscode-java-debug

Wrong Java runtime used JRE 11 vs. JRE 17

Đang mở
#1,406 8 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

ai-triaged bug
Ngôn ngữ chính
TypeScript
Star
591
Fork
429
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
19

Mô tả

Wrong Java runtime used

Environment
  • Operating System: ubuntu linux
  • JDK version: Corretto-17.0.9.8.1
  • Visual Studio Code version: latest
  • Java extension version: latest and prerelease
  • Java Debugger extension version: latest and prerealease
Steps To Reproduce
  1. Trying to debug spring boot

No special launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "java",
            "name": "Launch Application",
            "request": "launch",
            "mainClass": "de.xxx.xxx.Application",
            "projectName": "xxx-application",
            "env": {
                "SPRING_PROFILES_ACTIVE": "debug",
            },
            "vmArgs": "-Xms128m -Xmx128m"
        }
    ]
}

Java Configure Runtime for Projects outputs wrong java version

image

Should be 17 (works on other enviroments - E.g. eclipse)

Current Result
Error: Unable to initialize main class de.ewe.gisatfuture.servicehub.Application
Caused by: java.lang.UnsupportedClassVersionError: org/springframework/web/servlet/config/annotation/WebMvcConfigurer has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Expected Result

Debugger should simply run

Additional Informations

Workaround: mvn spring-boot:run does work

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện việc khởi chạy debug Spring Boot bằng launch.json được cung cấp và kiểm tra đầu ra của Java Configure Runtime for Projects. So sánh JRE được chọn ở đó với môi trường JDK 17 và runtime được trình gỡ lỗi sử dụng. Hoàn tất khi trình gỡ lỗi khởi chạy ứng dụng bằng JDK 17 thay vì JRE 11.

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, spring-boot, vscode
Lĩnh vực
devtools, tooling
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
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.