将JNLP打包为应用程序的选项似乎不存在于Oracle的JDK 7
Java首选项页面中,就像它在苹果中所做的那样,如
here所述
OS X desktop integration with Java Web Start lets users create a local
application bundle from any Java Web Start application. The Shortcut
Creation setting in Java Preferences controls whether the user is
prompted to create an application bundle when opening a Java Web Start
application. Bundled Java Web Start applications have all of the
benefits of native application bundles,which are described in “OS X
Application Bundles.”
为了解决这个问题,我使用Automator创建一个.app,它运行一个执行JNLP的shell脚本.这允许我使用应用程序图标,但我所有配置停靠图标的尝试都失败了.
我尝试使用iconutil创建一个.icns文件并将其添加到Resources文件夹,然后在“Icon File”字段下的Contents / Info.plist中指定.icns文件,但我仍然在Dock中获取java咖啡杯图标在运行应用程序时.
我尝试过的另一件事是将-Xdock:icon = icon.jpg参数传递给javaws,但这似乎只适用于常规java程序.
我找到了解决问题的方法.您可以直接在jnlp中引用它,而不是在.app文件中捆绑图标.
The JNLP Developer’s guide包含图标元素的描述
icon element: Contains an HTTP URL to an image file in either GIF or
JPEG format. The icons are used to represents the application
during launch when Java Web Start presents the application to the
user; in the Application Manager; in desktop shortcuts. A 64×64 icon
is shown during download; in the Application Manager and in desktop
shortcuts a 32×32 icon is used. Java Web Start automatically resizes
an icon to the appropriate size.
它没有明确提到那里的OSX底座,但是一个快速测试显示它确实在那里放置了图标.