Skip to content

Commit

Permalink
Minecraft Java Server: correct java 21 usage
Browse files Browse the repository at this point in the history
  • Loading branch information
theofficialgman committed Apr 6, 2024
1 parent 81265af commit 2125d2b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/Minecraft Java Server/install
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,15 @@ else
# we know the version of minecraft in use
# choose the appropriate version of java based on that
# version <= 1.16.5 java 8
# version >= 1.17 java 17
# 1.17 <= version < 1.21 java 17
# version >= 1.21 java 21
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d\n", $1,$2,$3); }'; }
if [ $(version $server_version) -le $(version "1.16.5") ]; then
echo "Using Java 8 by default"
java_selection="Java 8"
elif [ $(version $server_version) -ge $(version "1.21") ]; then
echo "Using Java 17 by default"
java_selection="Java 17"
echo "Using Java 21 by default"
java_selection="Java 21"
elif [ $(version $server_version) -ge $(version "1.17") ]; then
echo "Using Java 17 by default"
java_selection="Java 17"
Expand Down

0 comments on commit 2125d2b

Please sign in to comment.