我只是想从我的 Windows 计算机制作一个 JAR 文件或 APP 文件,以便 Mac 用户可以运行并查看更专业的应用程序。
最重要的是,我希望菜单栏标题显示程序的名称而不是启动程序包!我发现这真的很烦人,因为在 Windows 编程时,你不必担心那种废话。 Windows 只是向用户显示您在创建 JFrame 时命名的任何内容。 Mac 将完整的 Launcher 包名称放在左上角:
即 com.blah.initial.Launcher
我从 Java 教程中学到了一些内容,该教程介绍了如何将 Java 应用程序引入 Mac,但它并没有过多讨论如何进行从 Windows 机器上执行此操作。
我知道需要一个 XML 文件来告诉 Mac 程序信息......但我不确定如何在 Windows 上创建和打包所有这些信息。
任何帮助将不胜感激。
I simply want to make a JAR file or APP file from my Windows machine that mac users can run and see a more professional application.
Most importantly, I want the menu bar title to say the program's NAME not the launcher package! I find this really annoying since, when programming for Windows, you don't have to worry about that kind of crap. Windows just shows the user whatever you name your JFrame when you create it. Mac puts the full Launcher package name in the upper left-hand corner:
i.e. com.blah.initial.Launcher
I've learned some from a Java Tutorial that covered bringing Java applications to Mac, but it didn't talk very much about how to do it from a Windows machine.
I am aware that an XML file is needed to tell the Mac program information.... but I'm not sure how to create and package all of it on Windows.
Any help would be appreciated.
发布评论
评论(1)
如本示例所示,Mac 应用程序包 只是一个名称以
.app
结尾的目录树。一切准备就绪后,只需构建 JAR 并将其复制到目标目录,如项目build.xml
。Mac OS X 具有菜单栏和扩展坞;后者类似于任务栏。在这两种情况下,
当双击未修饰的 JAR 时,会显示完全限定的
Main-Class
名称。通过 java 启动时-web-start,名称取自title 属性。
对于应用程序包,名称取自
-Xdock:name
属性。As seen in this example, a Mac application bundle is just a directory tree with a name ending in
.app
. Once everything is laid out, just build your JAR and copy it to the destination directory, as shown in thebuild
target of the project'sbuild.xml
.Mac OS X has both menu bar and dock; the latter is similar to the task bar. In both,
When double clicking an unadorned JAR, the fully qualified
Main-Class
name appears.When launched via java-web-start, the name is taken from the the title property.
For an application bundle, the name is taken from the
-Xdock:name
property.