Running a .jar on a Mac

Solution 1:

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.