redhat-developer / redhat-developer/vscode-java
Can not build gradle project with jdk 17
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ả
My project requires jdk 17 to build. I use jenv to manage jdk and I set it to use java 17 locally but it seems the extension always use 21 to build project. I can build the project successfully in the terminal. I think the extension should use the java configured in java_home to build the project.
java home:
echo $JDK_HOME
/Users/user/.jenv/versions/17
Error log:
[info] [gradle-server] Gradle Server started, listening on 52563
[info] Gradle client connected to server
[info] Java Home: /Users/user/.cursor/extensions/redhat.java-1.43.1-darwin-arm64/jre/21.0.7-macosx-aarch64
[info] JVM Args: --add-opens=java.base/java.util=ALL-UNNAMED,--add-opens=java.base/java.lang=ALL-UNNAMED,--add-opens=java.base/java.lang.invoke=ALL-UNNAMED,--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens=java.base/java.nio.charset=ALL-UNNAMED,--add-opens=java.base/java.net=ALL-UNNAMED,--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=CN,-Duser.language=en,-Duser.variant
[info] Gradle User Home: /Users/user/.gradle
[info] Gradle Version: 7.6.4
[error] FAILURE: Build failed with an exception.
I tried to add the config below but still not working
"java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "/Users/user/.jenv/versions/17",
"default": true
}
],
"gradle.java.home": "/Users/user/.jenv/versions/17"
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 việc khởi động Gradle Server và xử lý Java Home được thể hiện trong nhật ký lỗi, sau đó theo dõi cách java.configuration.runtimes và gradle.java.home được đọc. Tái hiện bằng jenv và JDK 17 trong khi Gradle báo cáo JDK 21 đi kèm; hoàn tất khi dự án build được với JDK 17 đã cấu hình.
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
- Lĩnh vực
- build-system, 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
- 35/100