Building processing throws `UnsupportedClassVersionError` in `:core:examples:Basic.main()`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- java
- Lĩnh vực
- build-system
Hướng nghiên cứu
Bắt đầu với BUILD.md và các tệp Gradle, sau đó tái hiện :core:examples:Basic.main() bằng runtime JDK 17 được báo cáo. Truy tìm lý do Basic được biên dịch thành tệp lớp phiên bản 65 trong khi chạy trên runtime chỉ hỗ trợ phiên bản 61; công việc được hoàn tất khi build được ghi trong tài liệu và việc chạy ví dụ hoạt động mà không có UnsupportedClassVersionError.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I try to build processing with a clean clone of the repository.
Following the build instructions:
https://github.com/processing/processing4/blob/main/BUILD.md
1
The run button doesn't work in IntelliJ:
13:23:05: Executing ':core:examples:Basic.main()'…
Task :plugins:library:checkKotlinGradlePluginConfigurationErrors SKIPPED
Task :plugins:library:compileKotlin UP-TO-DATE
Task :plugins:library:compileJava NO-SOURCE
Task :plugins:library:pluginDescriptors UP-TO-DATE
Task :plugins:library:processResources UP-TO-DATE
Task :plugins:library:classes UP-TO-DATE
Task :plugins:library:jar UP-TO-DATE
Task :core:checkKotlinGradlePluginConfigurationErrors SKIPPED
Task :core:compileKotlin NO-SOURCETask :core:compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.Task :core:processResources
Task :core:classes
Task :core:jarTask :core:examples:compileJava
Task :core:examples:processResources NO-SOURCE
Task :core:examples:classes
Note: /Users/doeke/Documents/processing4-w_branches/core/examples/src/main/java/Basic.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.Task :core:examples:Basic.main() FAILED
[Incubating] Problems report is available at: file:///Users/doeke/Documents/processing4-w_branches/.build/reports/problems/problems-report.html
9 actionable tasks: 5 executed, 4 up-to-date
Error: LinkageError occurred while loading main class Basic
java.lang.UnsupportedClassVersionError: Basic has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':core:examples:Basic.main()'.Process 'command '/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
- Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.BUILD FAILED in 2s
13:23:08: Execution finished ':core:examples:Basic.main()'.
Which is triggered by: Runtime.getRuntime().exec("echo Hello World");
If I comment out those lines then I get:
17:06:15: Executing ':core:examples:Basic.main()'…
Task :plugins:library:checkKotlinGradlePluginConfigurationErrors SKIPPED
Task :plugins:library:compileKotlin UP-TO-DATE
Task :plugins:library:compileJava NO-SOURCE
Task :plugins:library:pluginDescriptors UP-TO-DATE
Task :plugins:library:processResources UP-TO-DATE
Task :plugins:library:classes UP-TO-DATE
Task :plugins:library:jar UP-TO-DATE
Task :core:checkKotlinGradlePluginConfigurationErrors SKIPPED
Task :core:compileKotlin NO-SOURCE
Task :core:compileJava UP-TO-DATE
Task :core:processResources UP-TO-DATE
Task :core:classes UP-TO-DATE
Task :core:jar UP-TO-DATE
Task :core:examples:compileJava
Task :core:examples:processResources NO-SOURCE
Task :core:examples:classesTask :core:examples:Basic.main() FAILED
9 actionable tasks: 2 executed, 7 up-to-date
Error: LinkageError occurred while loading main class Basic
java.lang.UnsupportedClassVersionError: Basic has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':core:examples:Basic.main()'.Process 'command '/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
- Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.BUILD FAILED in 872ms
17:06:16: Execution finished ':core:examples:Basic.main()'.
And so on...
Also if I check the module settings in IntelliJ then they default to 21 for me.
Upon checking the gradle files I see nowhere something among the lines of:
languageVersion = JavaLanguageVersion.of(17)
It seems like whoever made processing move away from maven to gradle had only JDK 17 installed.
I don't want to dig deeper cause I simply don't have the time but it would be nice if some housekeeping would take place.
- Ngôn ngữ chính
- Java
- Star
- 497
- Fork
- 183
- Merge trung bình
- 4 giờ 39 phút
- Pull request đã merge (30 ngày)
- 3
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.
Issue khác của processing/processing4
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
processing/processing4#1554 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
processing/processing4#1515 · 1 reaction ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
processing/processing4#1573 ·
-
startup error Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
processing/processing4#1569 · 7 bình luận ·
-
Binaries under bin directory lack executable permissions for the snap and .deb packages for Linux Đang mởbug
processing/processing4#1567 · 3 bình luận · 1 reaction · 1 người được giao ·
Tất cả issue của processing/processing4
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Đang mởbug frontend maui-pilot
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
objectionary/eo-graphs#74 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100