alan:AdventuresInMinecraft-Mac solitone$ ./StartServer.command
Adventures In Minecraft
Minecraft Server Version is 1.12
Note - make sure Minecraft is using 1.12
By continuing you are indicating your agreement to our EULA https://account.mojang.com/documents/minecraft_eula).
Press any key to continue
./StartServer.command: line 27: [: : integer expression expected
./StartServer.command: line 30: [: : integer expression expected
ERROR - Java needs to be updated.
Currently installed version is . - 1.8 is required
Visit adventuresinminecraft.github.io if you need help.
alan:AdventuresInMinecraft-Mac solitone$ java --version
java 11.0.1 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
alan:AdventuresInMinecraft-Mac solitone$
if [[ $token =~ \"([[:digit:]]+)\.([[:digit:]]+)\.(.*)\" ]]
if [[ $token =~ \"([[:digit:]])\.([[:digit:]])\.(.*)\" ]]
diff --git a/StartServer.command b/StartServer.command
index 537457c..82cb042 100755
--- a/StartServer.command
+++ b/StartServer.command
@@ -15,7 +15,7 @@ JAVA_VER_BUILD=""
for token in $(java -version 2>&1 | grep -i version)
do
- if [[ $token =~ \"([[:digit:]]+)\.([[:digit:]]+)\.(.*)\" ]]
+ if [[ $token =~ \"([[:digit:]])\.([[:digit:]])\.(.*)\" ]]
then
JAVA_VER_MAJOR=${BASH_REMATCH[1]}
JAVA_VER_MINOR=${BASH_REMATCH[2]}