How to set a launcher icon for the self-contained JavaFX2 application?

て烟熏妆下的殇ゞ 提交于 2019-12-12 01:35:01

问题


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.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:

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

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>

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

Regards, Aurelian


回答1:


I think you need to create a "package" directory in the base app directory, a "linux" directory inside the "package" directory and finally put Aurica.png in the "linux" directory.




回答2:


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...



来源:https://stackoverflow.com/questions/14105054/how-to-set-a-launcher-icon-for-the-self-contained-javafx2-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!