MacOS is not officially supported by Sun/Oracle that's why it's difficult to find some good documentation.It looks like the syntax of the java command is not correct as the classpath is not properly added to the java programm. But it failed with the following NoClassDefFoundError: Exception in thread 'main' : my/package/MyMainClassĬaused by: : my.package.MyMainClassĪt $1.run(URLClassLoader.java:202)Īt (Native Method)Īt (URLClassLoader.java:190)Īt (ClassLoader.java:306)Īt $AppClassLoader.loadClass(Launcher.java:301)Īt (ClassLoader.java:247) Now I thought MacOS will be quite similar to linux as both are unix based and I asked a friend with a mac to try to run the shellscript to launch my application. Java -Xss1024k -Xmn256m -Xms512m -Xmx1024m -cp lib/*:bin/myjar-latest.jar my.package.MyMainClass Javaw -Xss1024k -Xmn256m -Xms512m -Xmx1024m -cp lib/* bin/myjar-latest.jar my.package.MyMainClassįor linux I created a shell script like this launch-linux.sh: #!/bin/sh For Windows I created a batch file like this launch-win32.bat: off I created a Java application and need to prepare it to run on any OS.