From 031f770557513a4d462039b3392952fd079a9fa1 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 14 Apr 2023 11:46:56 +0800 Subject: [PATCH] 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 Closes #13514 --- unified/install.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/unified/install.sh b/unified/install.sh index 48b710739b..86d37bdcfe 100755 --- a/unified/install.sh +++ b/unified/install.sh @@ -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