How to set a launcher icon for the self-contained

2019-08-25 09:10发布

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

2条回答
We Are One
2楼-- · 2019-08-25 09:32

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.

查看更多
Anthone
3楼-- · 2019-08-25 09:44

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

查看更多
登录 后发表回答