Skip to content

Error when changing JDK to something other than the default #28

@nateha1984

Description

@nateha1984

If JAVA_HOME is set on the runner to something other than the default, the action fails with:

ERROR: JAVA_HOME is set to an invalid directory: /opt/hostedtoolcache/Java_Adopt_jdk/11.0.11-9/x64

Removing the Set up JDK 11 step allows the workflow to proceed without issue.

Sample workflow causing the error:

            on:
              push:
            
            jobs:
              get-version:
                runs-on: ubuntu-20.04
                steps:
                  - uses: actions/checkout@v2
            
                  - name: Set up JDK 11
                    uses: actions/setup-java@v2
                    with:
                      java-version: '11'
                      distribution: 'adopt'
            
                  - name: Get version from
                    uses: madhead/read-java-properties@c2ad203dff7a56a06aab9e3586bef5c1e36409c2
                    id: version
                    with:
                      file: gradle.properties
                      property: version

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededwontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions