问题
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