Vladimir Berlev
Vladimir Berlev

Reputation: 502

javafxpackager error

I try to pack my javafx project with javafxpackager. Everything works good (package is created), but I get error Error: jfxrt.jar needs to be on classpath for -createbss and for -createJar without -nocss2bin Ant script I use to call javafxpackager:

<exec executable="javafxpackager">
        <arg value="-createJar"/>
        <arg line="-classpath /jdk/jre/lib/jfxrt.jar"/>
        <arg line="-srcdir build"/>
        <arg line="-appclass org.shark.client.Shark"/>
        <arg line="-outdir packs"/>
        <arg line="-outfile Shark"/>
        <arg line="-manifestAttrs Main-Class=org.shark.client.Shark"/>
    </exec>

I absolutelly can't understand the reason.

Upvotes: 1

Views: 513

Answers (2)

jewelsea
jewelsea

Reputation: 159576

Add an extra argument -nocss2bin to your exec block. Converting the css to binary format is a performance optimization you would almost never really need anyway.

<exec executable="javafxpackager">
    <arg value="-createjar"/>
    <arg value="-nocss2bin"/>
    ...
</exec>

As you seem to be using ant already, I'd advise using the JavaFX ant tasks rather than invoking the javafxpackager through the exec block (same as tomsontom suggests).

Also note that, for java 7u12+, jfxrt.jar should be on the default execution path, so later java versions should not experience the issue you mention and explicitly setting -nocss2bin would no longer be required.

Upvotes: 0

tomsontom
tomsontom

Reputation: 5897

if you are already in ant why are you not useing javafx' ant extensions, I've not seen this problem there.

Upvotes: 1

Related Questions