加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

如何将jnlp与OSX停靠图标捆绑在一起;这在java首选项中似乎不再可

发布时间:2020-12-15 03:02:04 所属栏目:Java 来源:网络整理
导读:将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 Sh
将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底座,但是一个快速测试显示它确实在那里放置了图标.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读