java - 无法在 WinXP 32 位上为 JavaFX 应用程序构建 native 包

标签 java javafx javafx-2 javafx-8

我正在尝试为 WinXP 32 位系统构建一个 JavaFX 应用程序( native 包)。

我已经部署了 WinXP 32 位虚拟机。还安装了 JDK (jdk-8u65-windows-i586) 和 InnoSetup 和 Netbeans 8.0.2 ...

然而,当我尝试打包为 .EXE 应用程序时,我收到了:

Exception: java.io.IOException: Cannot run program "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\iconswap2855415551655584734.exe": CreateProcess error=193, %1 is not a valid Win32 application
C:\Documents and Settings\Administrator\My Documents\Netbeans Projects\AffideaDicomRouterBasic1_0_0\nbproject\jfx-impl.xml:3415: The following error occurred while executing this line:
C:\Documents and Settings\Administrator\My Documents\Netbeans Projects\AffideaDicomRouterBasic1_0_0\nbproject\jfx-impl.xml:3438: The following error occurred while executing this line:
C:\Documents and Settings\Administrator\My Documents\Netbeans Projects\AffideaDicomRouterBasic1_0_0\nbproject\jfx-impl.xml:1465: The following error occurred while executing this line:
C:\Documents and Settings\Administrator\My Documents\Netbeans Projects\AffideaDicomRouterBasic1_0_0\nbproject\jfx-impl.xml:3093: The following error occurred while executing this line:
C:\Documents and Settings\Administrator\My Documents\Netbeans Projects\AffideaDicomRouterBasic1_0_0\nbproject\jfx-impl.xml:2055: Error: Bundler "EXE Installer" (exe) failed to produce a bundle.
BUILD FAILED (total time: 35 seconds)

我的设置可以吗?我还有什么遗漏吗?

我认为,为了为 WinXP32 构建 JavaFX 应用程序,我应该只:

  • 在类似的 (WinXP32) 机器上构建它
  • 使用 X86 JDK 版本

然而这似乎还不够!

最佳答案

这个问题听起来像是您正在尝试将 jar 存档(或所有 .class 文件)打包到 exe 存档中。 我的答案基于该假设并试图解释和扩展 nextcard 的答案。如果我误解了你的问题,我很抱歉。另外,对于我的链接格式不正确,我深表歉意。我不允许发布超过一个链接。一旦我有 10 个声望,我会立即更正。

Java 不是编译语言。这意味着 .class 文件或 jar 存档不可执行。每个 Java 程序都需要使用通常称为 java.lang.JIT(即时编译器)的 JIT(即时编译器)启动。 如果您单击它们,系统能够执行 jar 存档,因为它知道必须在文件名前添加“java -jar”才能执行某些操作。

如果你想将 java 程序作为系统依赖的可执行文件,你必须使用 AOT(提前)编译器。那些产生真正的字节码,系统可以在通常运行 Java 程序的虚拟机上独立解释自己。另一种可能性是用 launch4j 包装 jar(nextcard 已经提到)

包装器:

AOT 编译器:

  • vmkit.llvm.org
  • gcc.gnu.org/java/
  • www.excelsiorjet.com

关于java - 无法在 WinXP 32 位上为 JavaFX 应用程序构建 native 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33386728/

相关文章:

java - JFXtras - 保存添加的约会

java - 在 JavaFX TextArea 中突出显示字符串

java - Modelmapper:将列表中的元素映射到 POJO 中的字段

java - 第二次身份验证失败 Java Mail API

tableview - JavaFX TableView 一列中的多个组件

java - 使用 Spring Boot 启动 JavaFX 2

java - 父舞台中央舞台

java - 调用随机函数

java - 在 Linux/Java 中调度文件/文件夹复制的应用程序

javafx - 如何创建带有 "Do not ask again"复选框的 JavaFX 警报?