Skip to content

setup-java does not set GRAALVM_HOME #1139

Description

@msgilligan

Description:

When setup-java installs graalvm-community it does not set GRAALVM_HOME. People like me who are migrating from graalvm/setup-graalvm@v1 will have builds that expect this env variable to be set.

I believe the same issue will be present for Oracle GraalVM, but I have not verified.

Task version:

v5.6.0

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:

Tun a build that requires GRAALVM_HOME to be set.

Expected behavior:

The build to succeed, the same as it did when using graalvm/setup-graalvm@v1.

Actual behavior:

The build fails (in my case by an invalid path to the native-image binary because my build is using GRAALVM_HOME to find it.)

Workaround:

Use:

  - name: Set up Java (GraalVM)
    uses: actions/setup-java@v5
    with:
      distribution: ${{ matrix.distribution }}
      java-version: ${{ matrix.java-version }}
      cache: 'gradle'
  # `actions/setup-java` doesn't set `GRAALVM_HOME` so we'll do it explicitly.
  - name: Set GRAALVM_HOME
    run: echo "GRAALVM_HOME=$JAVA_HOME" >> "$GITHUB_ENV"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions