1

When I do "Export Runnable Jar" from Eclipse, and run it from Terminal in OSX, the App-name (visible in menu) is always JarRsrcLoader.

I understand that this is because the MANIFEST.MF specifies that class as the startup class, and it in turn loads my main class.

Which method is the best to use if I want to have my main class name as the app's name?

jww
  • 97,681
  • 90
  • 411
  • 885
Peter Andersson
  • 1,947
  • 3
  • 28
  • 44

1 Answers1

0

I resolved this issue on my System (Java 8, Mac OS X 10.8). I resolved it by following this answer. Specifically, I was able to run MyJar.jar from the command line using:

java -Xdock:name="AppNameInMenu" -jar MyJar.jar

This way, instead of the menu being displayed as JarRsrcLoader, it now displays as AppNameInMenu.

In addition, on a related issue, this jar can be converted to an .app following this. But, instead of:

"java -jar " & p & "/Contents/Java/MyJar.jar"

You can use:

"java -Xdock:name=\"AppNameInMenu\" -jar " & p & "/Contents/Java/MyJar.jar"

You need the backslashes when using quotes embedded in quotes when using AppleScript (per this link)

Community
  • 1
  • 1
user2797422
  • 31
  • 2
  • 6