Running a .jar on a Mac I've recently been wishing I could still play a Minigolf game that came installed with my first cell phone, a Sony Ericsson T610 (eat your heart out, iPhone!), which roughly looked like this:



'Member?

There are good reasons to believe that the game is "abandonware" and that Sony Ericsson doesn't offer support for it anymore.

I think the game can be found as a .jar file online, and is either this one or this one. 

However, after downloading these files, I haven't been able to run them. Java is installed in the /Library folder of the Macintosh HD drive, and when I right-click the file to open it, I get a "The Java JAR file “Real_Minigolf_2005_128x128_SE_K300i-448093.jar” could not be launched. Check the Console for possible error messages." error message.

I have looked into this answer and this one, but neither have worked.

Is it possible to run these files on a Mac running El Capitan or above?
In general, you run a ‘runnable JAR’ by opening it or with Terminal java -jar /path/to/game.jar.

However, this JAR does not contain a suitable manifest for launching, i.e. not a runnable JAR.

$ java -jar /path/to/game.jar  
no main manifest attribute, in /path/to/game.jar


Therefore you have to specify the main class manually. However, that still doesn't work.

$ java -cp /path/to/game.jar E
Exception in thread "main" java.lang.NoClassDefFoundError: javax/microedition/lcdui/Graphics
[…]
Caused by: java.lang.ClassNotFoundException: javax.microedition.lcdui.Graphics
[…]


That's because this JAR doesn't support being run on a computer. It's a game for a mobile device and you can't launch it on a computer.