install.sh: use scylla-jmx for detecting JRE

now that scylla-jmx has a dedicated script for detecting the existence
of OpenJDK, and this script is included in the unified package, let's
just leverage it instead of repeating it in `install.sh`.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>

Closes #13514
This commit is contained in:
Kefu Chai
2023-04-14 11:46:56 +08:00
committed by Botond Dénes
parent 8bb1f15542
commit 031f770557

View File

@@ -107,14 +107,7 @@ if ! $skip_systemd_check && [ ! -d /run/systemd/system/ ]; then
exit 1
fi
has_java=false
if [ -x /usr/bin/java ]; then
javaver=$(/usr/bin/java -version 2>&1|head -n1|cut -f 3 -d " ")
if [[ "$javaver" =~ ^\"1.8.0 || "$javaver" =~ ^\"11.0. ]]; then
has_java=true
fi
fi
if ! $has_java; then
if ! scylla-jmx/select-java --version > /dev/null; then
echo "Please install openjdk-8 or openjdk-11 before running install.sh."
exit 1
fi