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

Error: Unable to find the latest Java version for '11' #105

Open
sanel opened this issue Sep 16, 2024 · 3 comments
Open

Error: Unable to find the latest Java version for '11' #105

sanel opened this issue Sep 16, 2024 · 3 comments

Comments

@sanel
Copy link

sanel commented Sep 16, 2024

Hi guys,

I'm trying to use this action with the follwing options:

      - uses: graalvm/setup-graalvm@v1
        with:
          java-version: '11'
          distribution: 'graalvm-community'
          components: 'native-image'
          version: '22.3.3'

and it fails with:

Error: Unable to find the latest Java version for '11'. Please make sure the java-version is set correctly.
If you think this is a mistake, please file an issue at: https://github.com/graalvm/setup-graalvm/issues.

Any ideas?

@fniephaus
Copy link
Member

Hi @sanel,
could you provide us with a link to the failing build? Also, it may help if you restart the build and enable debugging.

Just for the record, GraalVM CE 22.3.3 is here.

@sanel
Copy link
Author

sanel commented Sep 16, 2024

Sure @fniephaus:

I'm a bit new to GH actions, how to enable debugging? I've reverted workflows to use ayltai/setup-graalvm@v1 which worked before.

Let me know if you need anything else :)

@fniephaus
Copy link
Member

Thanks for sharing those links, @sanel. You can turn on debugging when you restart a build job (there's a checkbox for that).

Anyway, it seems the problem is that you're trying to use GraalVM CE JDK 11, which is quite old and unsupported. The build may actually work if you're using:

      - uses: graalvm/setup-graalvm@v1
        with:
          java-version: '11'
          components: 'native-image'
          version: '22.3.3'

Note the missing distribution property.

Do you really need to use JDK 11 or could you just upgrade to JDK 17, if not JDK 21?

matrei added a commit to grails/grails-forge that referenced this issue Oct 4, 2024
matrei added a commit to grails/grails-forge that referenced this issue Oct 7, 2024
* ci: Use Java 11 in 6.2.x branch

If native image is built with Java 17, application created with it will not be compatible with Java 11.

Error: LinkageError occurred while loading main class g621app.Application java.lang.UnsupportedClassVersionError: g621app/Application has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

* ci: graalvm +version -distribution

Test tip from graalvm/setup-graalvm#105 (comment)

* ci: Disable OSX Arm Native CLI

Graalvm cannot build Java 11 OSX Arm Native Image

Error: Failed to download graalvm-ce-java11-darwin-aarch64-22.3.3. Are you sure version: '22.3.3' and java-version: '11' are correct?
jamesfredley added a commit to grails/grails-forge that referenced this issue Oct 9, 2024
* Add grails-app/conf/spring/resources.groovy as a default feature (#366)

* Add grails-app/conf/spring/resources.groovy as a default feature to align with pre Grails 6 versions

* Set "executable" flag on grailsw

* Update to grails wrapper 4.0.1 - includes update-wrapper command for Grails 6 (#375)

* prep for grails 6.2.1 release (#376)

* [skip ci] Release v6.2.1

* chore: Bump version to 6.2.2-SNAPSHOT

* update grails-core to 6.2.2-SNAPSHOT (#379)

* update grails-core 6.2.2-SNAPSHOT

* Use Java 11 in 6.2.x branch (#382)

* ci: Use Java 11 in 6.2.x branch

If native image is built with Java 17, application created with it will not be compatible with Java 11.

Error: LinkageError occurred while loading main class g621app.Application java.lang.UnsupportedClassVersionError: g621app/Application has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

* ci: graalvm +version -distribution

Test tip from graalvm/setup-graalvm#105 (comment)

* ci: Disable OSX Arm Native CLI

Graalvm cannot build Java 11 OSX Arm Native Image

Error: Failed to download graalvm-ce-java11-darwin-aarch64-22.3.3. Are you sure version: '22.3.3' and java-version: '11' are correct?

* Include Geb/Selenium dependencies for MacOS Arch64 (#385)

* fix: Enable inclusion of Geb/Selenium deps for Macos Arch64

This was already enabled in another part of the code in
ad660a5

It looks like this was missed.

* test: Temporarily disable integrationTest task in create-app specs

Due to an issue with the integrationTest task during the create-app tests, the task is being temporarily disabled. The tests fail with `org.openqa.selenium.SessionNotCreatedException`, which seems to be related to the inclusion of Geb/Selenium dependencies for `OperatingSystem.MACOS_ARCH64`.

The apps in the create-app tests are created with `OperatingSystem.MACOS_ARCH64` as the operating system parameter, but will fail also for other operating systems.

This issue was likely masked before commit 8675723, when the Geb/Selenium dependencies were not included for MACOS_ARCH64. With the dependencies now included, the integrationTest task fails.

---------

Co-authored-by: Scott Murphy <[email protected]>
Co-authored-by: grails-build <[email protected]>
Co-authored-by: Mattias Reichel <[email protected]>
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

2 participants