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

Support Java 21 on CI #7966

Closed
mossmana opened this issue Mar 11, 2025 · 2 comments
Closed

Support Java 21 on CI #7966

mossmana opened this issue Mar 11, 2025 · 2 comments
Assignees

Comments

@mossmana
Copy link
Contributor

mossmana commented Mar 11, 2025

While attempting to build the Flutter IntelliJ plugin for IntelliJ 2025.1, the version of Java needed to be bumped from 17 to 21. Build is successful when run locally. This version also needs to be configured on the CI. Refer to ./tool/github.sh and ./tool/kokoro/setup.sh

  • What went wrong:
    Execution failed for task ':flutter-idea:compileJava'.
    > error: invalid source release: 21

#7963

@mossmana mossmana self-assigned this Mar 11, 2025
@mossmana mossmana reopened this Mar 11, 2025
@mossmana
Copy link
Contributor Author

Related: #7967

@mossmana
Copy link
Contributor Author

mossmana commented Mar 12, 2025

Investigation - Added logging to ./tool/github.sh (https://github.com/flutter/flutter-intellij/pull/7963/files#diff-b69f7145ef91717b5eec7e21d57643d051b1dd3e78ab95bacce2529bf43abfa2):

ls /usr/lib/jvm
temurin-11-jdk-amd64
temurin-1[7](https://github.com/flutter/flutter-intellij/actions/runs/13822518954/job/38670978251?pr=7963#step:3:8)-jdk-amd64
temurin-21-jdk-amd64
temurin-[8](https://github.com/flutter/flutter-intellij/actions/runs/13822518954/job/38670978251?pr=7963#step:3:9)-jdk-amd64
System Java version:
openjdk 17.0.14 2025-01-21
OpenJDK Runtime Environment Temurin-17.0.14+7 (build 17.0.14+7)
OpenJDK 64-Bit Server VM Temurin-17.0.14+7 (build 17.0.[14](https://github.com/flutter/flutter-intellij/actions/runs/13822518954/job/38670978251?pr=7963#step:3:15)+7, mixed mode, sharing)

Solution - set the JAVA_HOME and PATH environment variable to an available JDK 21 compatible version.
export JAVA_HOME=/usr/lib/jvm/temurin-21-jdk-amd64
...
export PATH=/usr/lib/jvm/temurin-21-jdk-amd64/bin:$PATH
...

java --version
openjdk 21.0.6 2025-01-21 LTS
OpenJDK Runtime Environment Temurin-21.0.6+7 (build 21.0.6+7-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.6+7 (build 21.0.6+7-LTS, mixed mode, sharing)

See: https://github.com/flutter/flutter-intellij/actions/runs/13822946487/job/38672266390?pr=7963

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant