Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not build native bundle for JavaFX application on WinXP 32-bit

I am trying to build a JavaFX application (native bundle) for WinXP 32-bit systems.

I have deployed a WinXP 32-bit Virtual Machine. Have also installed JDK (jdk-8u65-windows-i586) and InnoSetup and Netbeans 8.0.2 ...

However while i am trying to package as an .EXE application i receive:

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)

Is my setup ok? Am i missing anything else?

I thought that in order to build a JavaFX application for WinXP32 i should only:

  • Build it on a similar (WinXP32) machine
  • Use the X86 JDK edition

However this does not seem to be enough!

like image 447
thanili Avatar asked Oct 28 '15 09:10

thanili


1 Answers

The question sounds like you are trying to package the jar archive (or all .class files) into an exe archive. My answer is based on that assumption and trying to explain and extend the answer from nextcard. I am sorry if I misinterpreted your question. Also I am sorry for the bad formatting regarding my links. I am not allowed to post more than one link. I will correct that as soon as I have ten reputation.

Java is not a compiled language. That implies that the .class files or the jar archive are not executable. Every Java program need to be started using a JIT (Just in time compiler) which is typically called java. The system is able to execute jar archives if you click on them because it knows it has to add "java -jar" before the filename to be able to do something.

If you want to have the java program as an system dependend executable you have to use an AOT (Ahead of time) compiler. Those produce real bytecode the system can interpret itself independend on a virtual machine java programs are normally running in. One other possibility is to wrap the jar with launch4j (already mentioned by nextcard)

Wrapper:

  • launch4j

AOT-compiler:

  • vmkit.llvm.org
  • gcc.gnu.org/java/
  • www.excelsiorjet.com
like image 142
Fjolnir Dvorak Avatar answered Oct 06 '22 04:10

Fjolnir Dvorak