javapackager native windows bundle non empty app.classpath (package.cfg)

Stefan Kreutter openjfx-dev at kreutter.de
Mon Oct 6 20:13:38 UTC 2014


Hoping to address my question to the appropriate list...

Is it possible to use the javapackager (ant-tasks) to create a Windows exe and having the app.classpath property of package.cfg populated? I use something like this:

<fx:deploy nativeBundles="all" outdir="${basedir}/${dist.dir}" outfile="${application.title}" verbose="true" width="600" height="400">
    <fx:application name="${application.name}" mainClass="${javafx.main.class}"/>
    <fx:resources>
        <!-- include dependencies copied by the maven-dependency-plugin -->
        <fx:fileset dir="target/dependency" includes="*.jar" type="jar"/>
    </fx:resources>
    <fx:info title="${application.title}" category="${application.group}" vendor="${application.vendor}" copyright="${application.copyright}">
        <fx:icon href="${application.icon}"/>
    </fx:info>
</fx:deploy>

The directory target/dependency contains several jar files (which by the way end up properly in the generated JNLP file) but only the jar file of the main class is references in the package.cfg inside native/bundles/${application.title}/app/package.cfg:

app.mainjar=app-1.0-SNAPSHOT.jar
app.version=1.0
app.id=org.example.demo.app
app.preferences.id=org/example/demo/app
app.mainclass= org/example/demo/app/DemoApp
app.classpath=

In the source code of java/com/sun/javafx/tools/packager/bundlers/WinAppBundler.java I found the following comment:

> private void writePkgInfo(Map<String, ? super Object> params, File pkgInfoFile) throws FileNotFoundException {
>    [...]
>   //This will be emtry string for correctly packaged JavaFX apps
>   out.println("app.classpath=" + MAIN_JAR_CLASSPATH.fetchFrom(params));
>    [...]
> }

So it seems that having a classpath with <fx:deploy> besides the main JAR is not possible/wanted.

Thanks in advance,
Stefan



More information about the openjfx-dev mailing list