Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JVM version should be compatible with Gradle #14

Open
pohaoc2 opened this issue Sep 3, 2024 · 3 comments
Open

JVM version should be compatible with Gradle #14

pohaoc2 opened this issue Sep 3, 2024 · 3 comments
Assignees
Labels
type: docs Improvements or additions to documentation

Comments

@pohaoc2
Copy link

pohaoc2 commented Sep 3, 2024

First attemp to build the model (./gradlew build), I got the following error:

> startup failed:
  General error during semantic analysis: Unsupported class file major version 66
  java.lang.IllegalArgumentException: Unsupported class file major version 66

JVM and gradle versions I am using (./gradlew -version):

------------------------------------------------------------
Gradle 6.3
------------------------------------------------------------

Build time:   2020-03-24 19:52:07 UTC
Revision:     bacd40b727b0130eeac8855ae3f9fd9a0b207c60

Kotlin:       1.3.70
Groovy:       2.5.10
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          22.0.2 (Homebrew 22.0.2)
OS:           Mac OS X 14.3 aarch64

How I resolve this issue

  1. Install java@11: $ brew install openjdk@11
  2. Add JAVA_HOME path in my ~/.zshrc file: append this line in the .zshrc file: export JAVA_HOME="/opt/homebrew/opt/openjdk@11/" (change the java exe path if need)
  3. source ~/.zshrc
  4. Confirm using JVM@11. ./gradlew -version
------------------------------------------------------------
Gradle 6.3
------------------------------------------------------------

Build time:   2020-03-24 19:52:07 UTC
Revision:     bacd40b727b0130eeac8855ae3f9fd9a0b207c60

Kotlin:       1.3.70
Groovy:       2.5.10
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          11.0.24 (Homebrew 11.0.24+0)
OS:           Mac OS X 14.3 aarch64

Next steps

Add this to README.md file for developers.

@cainja
Copy link
Member

cainja commented Sep 3, 2024

This question specifically is a Gradle issue, where the latest version of Gradle 8.5 is not compatible with Java SE 22 (major version 66). I think that is outside the scope of our README.

However, the Java version for this project (SE 8) could potentially be added to the README? @jessicasyu

@jessicasyu jessicasyu added the type: docs Improvements or additions to documentation label Oct 3, 2024
@cainja cainja self-assigned this Oct 4, 2024
@cainja
Copy link
Member

cainja commented Oct 15, 2024

@jessicasyu my thoughts have somewhat changed on this issue, I think that the java version is sufficiently handled by the sourceCompatibility parameter in our gradle file rather than adding another redundant location to maintain with the JDK version. Do you have a different opinion on this? I haven't found a good example of people specifying a JDK in other open source projects separate from the gradle file. If you don't have strong feelings I'll think we should close this issue.

@jessicasyu
Copy link
Member

jessicasyu commented Oct 15, 2024

@cainja I'm all for having a single source of truth. We could consider adding a badge to the README that automatically displays the value of sourceCompatibility which addresses both concerns (not having redundant information and making the java version more prominent)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants