The jtreg script (at least 3.2.2_02 for Linux) contains
# Verify java version (1.)5 or newer used to run jtreg
version=`"$JT_JAVA" -version 2>&1 |
grep "java version" |
sed -e 's/^[^"]*"\([^"]*\)".*/\1/' -e 's/^1\.//' -e 's/\([1-9][0-9]*\).*/\1/'`
This expects that java -version prints a string beginning with "java version".
But openjdk java prints "openjdk version..."
The obvious fix is to use
grep -E "(java|openjdk) version" |
but parsing the output of java -version is always going to be a potential source of bugs.
Perhaps running the java executable and using standard system properties is more robust?
# Verify java version (1.)5 or newer used to run jtreg
version=`"$JT_JAVA" -version 2>&1 |
grep "java version" |
sed -e 's/^[^"]*"\([^"]*\)".*/\1/' -e 's/^1\.//' -e 's/\([1-9][0-9]*\).*/\1/'`
This expects that java -version prints a string beginning with "java version".
But openjdk java prints "openjdk version..."
The obvious fix is to use
grep -E "(java|openjdk) version" |
but parsing the output of java -version is always going to be a potential source of bugs.
Perhaps running the java executable and using standard system properties is more robust?
- duplicates
-
CODETOOLS-6664058 jtreg doesn't work with openjdk 6
- Closed
-
CODETOOLS-6672820 jtreg does not work with OpenJDK
- Closed