Java Error, but most recent update installed.

26 views
Skip to first unread message

Michelle Harfield

unread,
Nov 12, 2019, 3:18:53 PM11/12/19
to Adventures in Minecraft Forum
Hello, 

I've been following your instructions to get python working with Minecraft and I am having some issues. 

I am using OSX - Mojave 10.14.6, and have downloaded the Adventures in Minecraft files from GitHub. When I run the Start Server command, the console tells me ERROR Java needs to be updated, but my Java is updated to the the most recent - Java 8 Update 231with the developer kit installed also after following the help section. 

Can you help me fix this - my son is desperate to get coding :) 
Screenshot 2019-11-12 at 20.15.05.png

Martin O'Hanlon

unread,
Nov 13, 2019, 3:44:49 AM11/13/19
to Adventures in Minecraft Forum
Its an issue we have seen before, it stems from the way macOS manages Java versions which is a bit strange.

The fix is usually to install the latest JDK (Java Development Kit).

There is a section on the macos help page on the adventures in minecraft site - https://adventuresinminecraft.github.io/help_mac.html#javaneedsupdating

solitone

unread,
Nov 16, 2019, 1:54:24 AM11/16/19
to Adventures in Minecraft Forum
With v. 1.12 MacOs Starter Kit, I have the same problem, although I have java 11:

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$ 


There's an error in the regular expression used for finding java version. Since the major number now is 2 digits, line number 18 should be:

   if [[ $token =~ \"([[:digit:]]+)\.([[:digit:]]+)\.(.*)\" ]]


instead of:

   if [[ $token =~ \"([[:digit:]])\.([[:digit:]])\.(.*)\" ]]


solitone

unread,
Nov 16, 2019, 2:07:54 AM11/16/19
to Adventures in Minecraft Forum

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]}

Martin O'Hanlon

unread,
Dec 16, 2019, 4:43:10 PM12/16/19
to Adventures in Minecraft Forum
Thanks for letting me know.

I have updated the macos starter kit to resolve the issue with using JDK v 1.1x

Reply all
Reply to author
Forward
0 new messages