Skip to content

Commit

Permalink
7903732: Verify that the java executable exists
Browse files Browse the repository at this point in the history
Reviewed-by: cstein, jjg
  • Loading branch information
Ludvig Janiuk committed May 28, 2024
1 parent a66a526 commit 046a70d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/share/bin/jtreg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ elif [ -n "$wsl" -a -x "$JTREG_JAVA".exe ]; then
driveDir=mnt
fi

if [ ! -e "$JTREG_JAVA" ]; then
echo "No java executable at $JTREG_JAVA"
exit 1;
fi

# Verify java version 11 or newer used to run jtreg
version=`"$JTREG_JAVA" -classpath "${JTREG_HOME}/lib/jtreg.jar" com.sun.javatest.regtest.agent.GetSystemProperty java.version 2>&1 |
grep 'java.version=' | sed -e 's/^.*=//' -e 's/^1\.//' -e 's/\([1-9][0-9]*\).*/\1/'`
Expand Down

0 comments on commit 046a70d

Please sign in to comment.