如何为自包含的JavaFX2应用程序设置启动器图标? [英] How to set a launcher icon for the self-contained JavaFX2 application?

查看:478
本文介绍了如何为自包含的JavaFX2应用程序设置启动器图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功创建了一个本机部署ant脚本,以便从我的JavaFX2应用程序中生成.deb。但是我似乎无法为其设置启动器图标。我遵循了两个步骤:

I've successfully created a native deploy ant script to make a .deb from my JavaFX2 application. However I can't seem to put a launcher icon for it. I had followed 2 steps:

1.设置ant-javafx的类路径以包含当前目录并将我的基本应用程序dir放入我的图标文件Aurica.png (classpath =。:/ home / aureliangtx / programs / java / lib / ant-javafx.jar)。但是,fx:deploy的ant详细输出状态:

1.Set the classpath for the ant-javafx to include the current directory and put in my base app dir my icon file, Aurica.png ( classpath=".:/home/aureliangtx/programs/java/lib/ant-javafx.jar" ). However, the ant verbose output for the fx:deploy states:

使用默认包资源[menu icon](将package / linux / Aurica.png添加到类路径到自定义)

Using default package resource [menu icon] (add package/linux/Aurica.png to the class path to customize)

2.我试图在fx:deploy中设置fx:icon,如Igor所述(https://blogs.oracle.com/ talkjavadeployment / entry / packaging_improvements_in_jdk_7#7),但结果是一样的。

2.I've tried to set the fx:icon in fx:deploy as, stated by Igor here (https://blogs.oracle.com/talkingjavadeployment/entry/packaging_improvements_in_jdk_7#7), but the outcome is the same.

<fx:info>
    <fx:icon href="Aurica.png" />
</fx:info>

这可能是Linux上的错误,或者我在这里做错了什么?

Is it a bug on Linux maybe, or I am doing something wrong here?

问候,
Aurelian

Regards, Aurelian

推荐答案

我终于解决了这个问题..我这是一个很大的错误。当我第一次安装Ant时,我还将ant-javafx库复制到Ant的lib文件夹中。我还在我的build.xml中通过taskdef重新定义它,所以我想在类加载时,第一个jar被加载,结果我的设置(例如来自taskdef的当前dir类路径)被忽略了。我为愚蠢而道歉......

I've finally solved this... it was a big mistake from my part. When I first installed Ant I also copied the ant-javafx library into Ant's lib folder. Also I was redefining it in my build.xml through taskdef, so I guess at class loading, the first jar was loaded and as a result my settings ( such as current dir classpath from the taskdef) were ignored. I apologize for stupidity...

这篇关于如何为自包含的JavaFX2应用程序设置启动器图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆