Skip to content

Commit

Permalink
scripts: accept java 17-21
Browse files Browse the repository at this point in the history
Motivation:
dCache master build with `--release=17` can run under java-21. Let
script reflect that.

Modification:
Update script to allow java 17-21 runtime.

Result:
accept java 17-21 for runtime

Acked-by: Karen Hoyos
Target: master
Require-book: no
Require-notes: yes
  • Loading branch information
kofemann committed Sep 24, 2024
1 parent 6885af3 commit 2400de1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions skel/share/lib/loadConfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ findJava()

isJavaVersionOk()
{
# Should match 11-19, which will let java major versions 11 to 19 through.
# Should match 17-21 which will let java major versions 17 to 21 through.
# Extract just the version number from 'java -version'
version=$($JAVA -version 2>&1 | awk -F '"' '/version/ {print $2}')
# Use grep to match against '^1[1-9].*$'
echo "$version" | grep -q "^1[1-9].*$"
echo "$version" | grep -q "^1[7-9].*$\|^2[0-1].*$"
# Return result from the above grep (0 if successful, 1 if failed)
return $?
}
Expand Down Expand Up @@ -182,7 +182,7 @@ loadConfig()

# Get java location
if ! findJava || ! isJavaVersionOk; then
echo "Could not find usable Java VM. Please set JAVA_HOME to the path to Java 11"
echo "Could not find usable Java VM. Please set JAVA_HOME to the path to Java 17-21"
echo "or newer."
exit 1
fi
Expand Down

0 comments on commit 2400de1

Please sign in to comment.