From 3c6709034049d169fd218fe62d06fea693d2dd8a Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Fri, 23 Feb 2024 08:22:08 +0100 Subject: [PATCH] Use `-version` on JDK 8. Fixes #86 --- .github/workflows/test.yml | 12 ++++++++---- dist/main/index.js | 2 +- src/main.ts | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 246c568..3e18c4d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -102,8 +102,12 @@ jobs: java-version: '17' components: 'native-image' os: ubuntu-20.04 + - version: '21.2.0' + java-version: '8' # for JDK 8 notification + components: 'native-image' + os: ubuntu-latest - version: '22.3.1' - java-version: '11' # for JDK11 notification + java-version: '11' # for JDK 11 notification components: 'native-image' os: macos-11 - version: '22.3.1' @@ -132,8 +136,8 @@ jobs: [[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 23 fi echo "JAVA_HOME: $JAVA_HOME" - java --version - java --version | grep "GraalVM" || exit 34 + java -version + java -version | grep "GraalVM" || exit 34 native-image --version if [[ "${{ matrix.java-version }}" != "dev" ]]; then gu list @@ -143,7 +147,7 @@ jobs: run: | echo "GRAALVM_HOME: $env:GRAALVM_HOME" echo "JAVA_HOME: $env:JAVA_HOME" - java --version + java -version native-image --version gu.cmd remove native-image if: runner.os == 'Windows' diff --git a/dist/main/index.js b/dist/main/index.js index 1db7373..7784c34 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -94364,7 +94364,7 @@ function run() { (0, reports_1.setUpNativeImageBuildReports)(isGraalVMforJDK17OrLater, graalVMVersion); core.startGroup(`Successfully set up '${(0, path_1.basename)(graalVMHome)}'`); yield (0, exec_1.exec)((0, path_1.join)(graalVMHome, 'bin', `java${c.EXECUTABLE_SUFFIX}`), [ - '--version' + javaVersion.startsWith('8') ? '-version' : '--version' ]); core.endGroup(); } diff --git a/src/main.ts b/src/main.ts index b331a6d..87d6e82 100644 --- a/src/main.ts +++ b/src/main.ts @@ -155,7 +155,7 @@ async function run(): Promise { core.startGroup(`Successfully set up '${basename(graalVMHome)}'`) await exec(join(graalVMHome, 'bin', `java${c.EXECUTABLE_SUFFIX}`), [ - '--version' + javaVersion.startsWith('8') ? '-version' : '--version' ]) core.endGroup() } catch (error) {