Waxren
Waxren

Reputation: 2172

JavaFX Deployment Issue

I am developing JavaFX 8 application on Windows 8.1 64bit with 4GB RAM using Netbeans 8.0.2 Which is running with JDK version 8u25 64bit.

The Application Platform is JDK version 8u25 32bit , the problem is when I build the project the application runs normally but when I do native packaging so I can ship 32 bit JRE along with exe file for the application netbeans outputs this message and skip building native package :

"Bundler Windows Application Image skipped because of a configuration problem: Bit architecture mismatch between FX SDK and JRE runtime.
Advice to fix: Make sure to use JRE runtime with correct bit architecture.
"

This is My Target tag from Build.xml file of the project :

<target name="-post-jfx-deploy">
<fx:deploy width="${javafx.run.width}" height="${javafx.run.height}"
       nativeBundles="image"
       outdir="${basedir}/${dist.dir}" outfile="${application.title}">
    <fx:platform basedir="${java.home}"/>  
    <fx:platform basedir="C:\Program Files (x86)\Java\jdk1.8.0_25\jre"/> 
    <fx:application name="${application.title}" mainClass="${javafx.main.class}"/>
    <fx:resources>
        <fx:fileset dir="${basedir}/${dist.dir}" includes="*.jar"/>
    </fx:resources>
    <fx:info title="${application.title}" vendor="${application.vendor}"/>
</fx:deploy>

So my qusestion is why Netbeans mismatches FX SDK version from the project Platform ? Although I have specified in the project settings to use 32 bit JDK and in the build.xml file also and How to ship the application with the 32 bit JRE?.

Upvotes: 4

Views: 2249

Answers (1)

Waxren
Waxren

Reputation: 2172

I finally found the solution in order to make native 32 bit packaging of JavaFX 8 application on 64 bit Windows. You have to change Netbeans Default Platform to 32 Bit (x86) JDK so to solve the problem I did the following :-

  1. Launched Notepad++ as administrator.

  2. Opened C:\Program Files\NetBeans 8.0.2\etc\netbeans.conf

  3. Changed (I have updated my JDK from 8u25 to 8u40)

    netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_40"

    To

    netbeans_jdkhome="C:\Program Files (x86)\Java\jdk1.8.0_40"

  4. Changed Project Platform to default platform to match netbeans default platform and Changed platform tag in build.xml to

    <fx:platform basedir="C:\Program Files (x86)\Java\jdk1.8.0_40\jre"/>

And Netbeans did native packaging like a charm

Upvotes: 4

Related Questions