简体   繁体   English

JavaFX部署问题

[英]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 . 我正在使用Netbeans 8.0.2Windows 8.1 64bit4GB RAM上开发JavaFX 8应用程序,它运行的是JDK版本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 : 应用程序平台是JDK版本8u25 32位 ,问题是当我构建项目时应用程序正常运行但是当我进行本机打包时,我可以运送32位JRE以及exe文件,用于应用程序netbeans输出此消息并跳过构建本机包:

" Bundler Windows Application Image skipped because of a configuration problem: Bit architecture mismatch between FX SDK and JRE runtime. 由于配置问题,Bundler Windows应用程序映像被跳过:FX SDK和JRE运行时之间的位体系结构不匹配。
Advice to fix: Make sure to use JRE runtime with correct bit architecture. 修复建议:确保使用正确的位体系结构的JRE运行时。 "

This is My Target tag from Build.xml file of the project : 这是项目的Build.xml文件中的My Target标记:

<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 ? 所以我的问题是为什么Netbeans与项目平台的FX SDK版本不匹配? 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? 虽然我在项目设置中指定使用32位JDK并在build.xml文件中也指定了如何使用32位JRE发送应用程序 .

I finally found the solution in order to make native 32 bit packaging of JavaFX 8 application on 64 bit Windows. 我终于找到了解决方案,以便在64位 Windows上进行JavaFX 8应用程序的原生32位打包。 You have to change Netbeans Default Platform to 32 Bit (x86) JDK so to solve the problem I did the following :- 您必须将Netbeans默认平台更改为32位(x86)JDK ,以解决我执行以下操作的问题: -

  1. Launched Notepad++ as administrator. 以管理员身份推出Notepad ++。

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

  3. Changed (I have updated my JDK from 8u25 to 8u40) 改了 (我已经将我的JDK从8u25更新到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 Project Platform 更改为默认平台,以匹配netbeans默认平台和build.xml Changed platform标签

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

And Netbeans did native packaging like a charm 而Netbeans的本土包装就像魅力一样

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM