On a PC, this issue would not arise, but I have a mac and the java menu bars typically appear on the top left hand area of the screen. For example (from the apple developers website):
The blue highlighted menu is the same name as the main class in a java program. I was wondering how I could name my main method class with a space in between two words rather than an underscore.
I tried...
-Xdock:name="My App Name"
on the command lineSystem.setProperty("com.apple.mrj.application.apple.menu.about.name", "Not My Mac App");
within themain
method before before and after setting the look and feelOnly
-Xdock:name
worked.Tested using Java 8 on 10.9.4, so the settings might be different for earlier version of Java and OS combinations
You may also consider creating a proper Mac .app bundle, which should allow you to set these properties via the
plist
file...Take a look at Packaging a Java App for Distribution on a Mac. It is "slightly" out of date, but should lead you in the right direction