processing / processing/processing4
Building processing throws `UnsupportedClassVersionError` in `:core:examples:Basic.main()`
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 494
- フォーク
- 183
- 平均マージ
- 4時間 39分
- マージ済み PR(30日)
- 3
説明
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
BUILD.md と Gradle ファイルから始め、報告された JDK 17 runtime を使って :core:examples:Basic.main() を再現します。Basic がクラスファイルバージョン 65 としてコンパイルされる一方で、バージョン 61 しかサポートしない runtime で実行される理由を追跡します。完了条件は、ドキュメントに記載された build と example の実行が UnsupportedClassVersionError なしで動作することです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- build-system
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100