How to change the Java application name shown in the Mac OS X launchpad

前端 未结 4 1985
予麋鹿
予麋鹿 2021-02-20 07:33

When my application written in Java with SWT runs under OS X, both from under Eclipse and from jar, its name in

4条回答
  •  孤街浪徒
    2021-02-20 07:54

    The only answer that worked for me is here. In short:

    Using JDK8, you can set the apple.awt.application.name property to affect the Application menu name.

    However, Martijn Courteaux’s warning that you must do this before any AWT classes are loaded still applies. And AWT classes will be loaded before your main() method runs if it lives in a subclass of JFrame.

    In other words, set apple.awt.application.name and do it before creating the JFrame.

    P.S. If you're trying to change the dock application title, this command might work:

    java -Xdock:name=Alfabet

提交回复
热议问题