0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[open-jdk 22 + Gradle 8.7] エラー "BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 66"

Posted at

環境

  • Windows10
  • open-jdk 22.0.1
  • open-jdk 21
  • Gradle 8.7

エラー発生

まず、open-jdk 22.0.1 と Gradle 8.7という組み合わせで、
gradle clean build を叩いた際に、下記のエラーが発生しました。

FAILURE: Build failed with an exception.

* What went wrong:
BUG! exception in phase 'semantic analysis' in source unit 
'_BuildScript_' Unsupported class file major version 66

エラーについての情報

このエラーについては、下記のISSUEが立っていました。
下記ISSUEはJavaではなくReactに対してのISSUEですが、
Gradle 8.7を動かすのにJava22ではエラーになるとのことです。

Java21に落とせば、エラーが出なくなる
とのことで、実際にjdk21に切り替えたら正常にビルドされました。

Unsupported class file major version 66 error. #2348

Compatibility Matrix (Gradle+JDKとのバージョンの対応一覧)

確かにJava22では「Support for running Gradle」が「N/A」になっていますね。

-----以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?