Fix system java detection
This commit is contained in:
parent
2845e4cd4f
commit
5b637cf84d
@ -86,17 +86,17 @@ function check_script_java {
|
||||
|
||||
# Get the system Java version
|
||||
function check_java_exec {
|
||||
# Check if java is installed
|
||||
if ! command -v java &> /dev/null
|
||||
then
|
||||
# Check if java is installed
|
||||
if ! command -v java &> /dev/null; then
|
||||
java_version=false
|
||||
fi
|
||||
|
||||
# If java is installed, get the version (the java_version won't be 0)
|
||||
if [[ $java_version != false ]]; then
|
||||
else
|
||||
# Get the current Java version and extract the build number
|
||||
java_version=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' | awk -F '.' '{print $1}')
|
||||
fi
|
||||
|
||||
if [[ $java_version != $required_java ]]; then
|
||||
java_version=false
|
||||
fi
|
||||
}
|
||||
|
||||
# Get the required Java version for the Minecraft version
|
||||
|
@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
EXTRA_SCRIPTS_VERSION="v1.1.6"
|
||||
EXTRA_SCRIPTS_VERSION="v1.1.7"
|
||||
|
2
msman.sh
2
msman.sh
@ -8,7 +8,7 @@ set -e
|
||||
# and acknowledge the original script and author. #
|
||||
#############################################################################################################
|
||||
|
||||
CURRENT_SCRIPT_VERSION="v1.1.6"
|
||||
CURRENT_SCRIPT_VERSION="v1.1.7"
|
||||
|
||||
# --------------------------------------------------
|
||||
# You shouldn't need to change anything in this file
|
||||
|
Loading…
x
Reference in New Issue
Block a user