Skip to content

Java 17 install is skipped by mistake if a wrong Java version is already installed #2

@mschmidm

Description

@mschmidm

Hey there! Thank you for the nice action!

I found that Java is only installed if no Java version is installed. In my case, Java 11 was already installed, and because of that, Java 17 was not installed by this action.

It would be great if the java installed check would also check for the version. Maybe something like this would do the job:

- name: Check if Java 17 is installed
  id: check_java
  shell: bash
  run: |
    if java -version 2>&1 | grep -q '17\.'; then
        echo "installed=true" >> "$GITHUB_OUTPUT"
    else
        echo "installed=false" >> "$GITHUB_OUTPUT"
    fi

Workaround for now:
Add this step manually before the action-flutter-build-android step:

- name: Install java
    uses: actions/setup-java@v3
    with:
      distribution: "zulu"
      java-version: "17.x"
      cache: "gradle"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions