Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

including an icon into a self-contained JavaFX application (.exe)

Followed the instructions here and here. I am using JDK 7u9 and NetBeans 7.2.1. What I did was create the whole path relative to my project's root folder (C:\Users\Administrator\Desktop\icotest\package\windows\icotest.ico). I tried both with a 48x48 and a 256x256 size. Here's a tree overview for my project called icotest:

│   build.xml
│   manifest.mf
│
├───build
│   │   built-jar.properties
│   │
│   ├───classes
│   │   └───icotest
│   │           Main$1.class
│   │           Main.class
│   │
│   ├───empty
│   └───generated-sources
│       └───ap-source-output
├───dist
│   │   icotest.html
│   │   icotest.jar
│   │   icotest.jnlp
│   │
│   └───web-files
│           dtjava.js
│           error.png
│           get_java.png
│           get_javafx.png
│           javafx-chrome.png
│           javafx-loading-100x100.gif
│           javafx-loading-25x25.gif
│           upgrade_java.png
│           upgrade_javafx.png
│
├───nbproject
│   │   build-impl.xml
│   │   genfiles.properties
│   │   jfx-impl.xml
│   │   project.properties
│   │   project.xml
│   │
│   ├───configs
│   │       Run_as_WebStart.properties
│   │       Run_in_Browser.properties
│   │
│   └───private
│       │   private.properties
│       │   private.xml
│       │
│       └───configs
│               Run_as_WebStart.properties
│               Run_in_Browser.properties
│
├───package
│   └───windows
│           icotest.ico
│
└───src
    └───icotest
            Main.java

This is what build.xml looks like:

<target name="-post-jfx-deploy">
    <fx:deploy verbose="true" nativeBundles="exe" outdir="${basedir}/${dist.dir}" outfile="${application.title}">
        <fx:application name="${application.title}" mainClass="${javafx.main.class}"/>
        <fx:resources>
            <fx:fileset dir="${basedir}/${dist.dir}" includes="*.jar"/>
            <fx:fileset dir="${basedir}/${dist.dir}" includes="lib/*.jar"/>
        </fx:resources>
        <fx:info title="${application.title}" vendor="${application.vendor}"/>
        <fx:preferences shortcut="true"/>
    </fx:deploy>
</target>

No matter what I do - I still get this message during the dist build process (that activates ISS) with the debug flag set to true in the according build.xml file: "Using default package resource [application icon] (add package/windows/icotest.ico to the class path to customize)"

Any idea what I might be doing wrong? Thank you.

like image 505
XXL Avatar asked Dec 03 '12 12:12

XXL


Video Answer


1 Answers

Found the answer here. It appears that the guidelines posted on the Oracle's website are currently mismatching the actual deployment scenarios available. Namely, when dealing with NetBeans, ant is unaware of the current directory that is presumed to be your root project. As it has been suggested in the according forum thread - simply add the directory containing "package/windows/${projectname}.ico" to ant's classpath and it will pick up the relevant resource, even though the tutorial claims that this should happen automatically due to the existing (?) addition of '.' to the build script.

todo

like image 157
XXL Avatar answered Oct 12 '22 12:10

XXL