Question Terasology will not start up from run_macosx.command

skillsetnone

New Member
When clicked it opens up a console which ends in error about about unsupported major.minor version. Which is apparently Apples Java version 6 trying to run the game. I have 7 installed because my browser requires the newest version or else most web java apps will not run. Can you update your startup command to use the browser based installation or maybe implement something like this?

#!/bin/sh
#Runs browser based Java binary if found therwise it will try the OS default Java
#
cd "$(dirname "$0")"

if [ -f /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java ]
then
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -Xms128m -Xmx1024m -jar Terasology.jar
else
java -Xms128m -Xmx1024m -jar Terasology.jar
fi
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Hi @skillsetnone ! Thanks for the details, nice to have a solution included right there in a support post :)

I have no clue about Macs and can't test the change. Could simply commit that in, but would that match any sort of convention of how to detect a proper Java on Macs? Would other users potentially want to prefer the OS level Java over browser-based Java?
 

skillsetnone

New Member
What are the requirements to run Terasology? I don't think it should be pointed to Apples Java as used in the current startup script if it doesn't work?

I'm not sure what is the proper convention for determining which to use but I think I found some documentation that might clarify which one should be used.

This states that OSX 10.6 and below came with Apples Java implementation (game doesn't run, see below). http://www.java.com/en/download/faq/java_mac.xml

SSN-MacBook-Pro:tera SSN$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
SSN-MacBook-Pro:tera SSN$ java -Xms128m -Xmx1024m -jar Terasology.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/terasology/engine/Terasology : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
SSN-MacBook-Pro:tera SSN$

OSX 10.7 and above shipped without any Java preinstalled and users are instructed to install Oracles Java (as seen in the apple support document). In my case I had installed Apple Java 6 to run an app related to my work but I had not installed Oracles Java at the time. After googling my problem I came across the fix from this posting http://forum.terasology.org/threads/problem-with-startup-when-using-run_macosx-command.848/ and so I tried to run the game using Oracles Java 7 and it ran.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
There is some good news on the horizon in either case - we have some ongoing work to actually bundle the needed Java with the game itself, which should remove this problem :)

@shartte is working on it on and off, so we could probably handle it that way rather than worry too much about the script. Although maybe like the Gradle script it can be made to better log what's going on when it fails.
 
Top