Java and Mac issue

Archives Forums/MacOS X Discussion/Java and Mac issue

Tricky(Posted 2014) [#1]
For a few months now I am part of a indie game community and I often like to download something there. As I am a Mac User my options are of course limited as most games are written for Windows.

However, all Java games should work on all platforms, but so far none of them works on my Mac, and it all seems to come down to Mac. I've trying to do some research on this, and it appears to be a known problem as Apple seems to have messed up the Java support completely since Lion (I am on Mountain Lion btw).

Reseach indicated I have two versions of Java on my Mac. 1.6 (maintained by Apple) and 1.7 (maintained by Oracle). My guess is that the wrong version of Java is loaded whenever I double-click a .jar file, but I cannot be sure. None of the sources I could find on this issue came with a solution.

Aside from that, I am investigating if Java could be a good target for my own productions (though I'm not sure Java is the way I wanna go), but aside from the language itself, I don't want to encounter these strange compatibility issues.

As far as I could find out the Java apps that refuse to work on my Mac appear to work on Windows (that's what I can make out on the comments Windows users made), and I think (though this is confirmed) Linux wasn't a real problem either.

Do you know a solution? Or can I better forget about playing Java games on my Mac. (jEdit and Eclipse, both Java apps as far as I know do work on Mac).


Brucey(Posted 2014) [#2]
Things like eclipse and minecraft (to name two reasonably popular java products that run on OS X) use something called a launcher - This is like an exe or script that does some basic configuration before running the actual java application.

I just checked, and Oracle's SQLDeveloper uses an app bundle and a shell script to kick everything off - SQLDeveloper is a java application.

Running a jar though, should generally work on OS X - just by double-clicking it in the finder.

You can also try launching it from the terminal :
java -jar JARNAME.jar

which might give you some more clues (errors, etc) about the problems of it starting/crashing.


Tricky(Posted 2014) [#3]
Thanks a lot, Brucey.
Well, odd as it may seem, the latest Java game I downloaded refuses to work when I double click the jar file in the finder (it will produce a window which closes immediately and ends). When I run it from the terminal with your "java -jar" command it runs (I could at least see the title screen and main menu. When running from the finder I won't get that far).

Anyway, my problem appears solved for now. Thanks again ;)


azrak(Posted 2014) [#4]
Launch the Java Control Panel on Mac OS X (10.7.3 and above):

Click on Apple icon on upper left of screen.
Go to System Preferences
Click on the Java icon to access the Java Control Panel.
switsh the order of jvm version in Java Runtime Enironment Settings.