Skip to content
This repository has been archived by the owner on Sep 8, 2023. It is now read-only.

Commit

Permalink
Fix system java detection
Browse files Browse the repository at this point in the history
  • Loading branch information
jiriks74 committed Feb 27, 2023
1 parent 2845e4c commit 5b637cf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions .msman/java.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .msman/version.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

EXTRA_SCRIPTS_VERSION="v1.1.6"
EXTRA_SCRIPTS_VERSION="v1.1.7"
2 changes: 1 addition & 1 deletion msman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5b637cf

Please sign in to comment.