diff --git a/.msman/java.sh b/.msman/java.sh index 444c73b..73fc308 100644 --- a/.msman/java.sh +++ b/.msman/java.sh @@ -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 - java_version=false - fi - - # If java is installed, get the version (the java_version won't be 0) - if [[ $java_version != false ]]; then + # Check if java is installed + if ! command -v java &> /dev/null; then + java_version=false + 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 diff --git a/.msman/version.sh b/.msman/version.sh index 60c9cd8..83ddb2b 100644 --- a/.msman/version.sh +++ b/.msman/version.sh @@ -1,3 +1,3 @@ #!/bin/bash -EXTRA_SCRIPTS_VERSION="v1.1.6" +EXTRA_SCRIPTS_VERSION="v1.1.7" diff --git a/msman.sh b/msman.sh index 4e74906..14ff6d1 100755 --- a/msman.sh +++ b/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