I am trying to package an application with jpackage
for Windows. I am using Java 19
and WiX 4
.
Package Id Version Commands
---------------------------------------------
wix 4.0.0-preview.1 wix
java 19.0.1 2022-10-18
Java(TM) SE Runtime Environment (build 19.0.1+10-21)
Java HotSpot(TM) 64-Bit Server VM (build 19.0.1+10-21, mixed mode, sharing)
According to the Packaging Tool User's Guide
, the requirements for generating an installation package for windows are:
WiX 3.0 or later is required.
However, when trying to generate a package I get an error:
[09:26:34.026] Can not find WiX tools (light.exe, candle.exe)
[09:26:34.026] Download WiX 3.0 or later from https://wixtoolset.org and add it to the PATH.
The very nature of the problem is clear. jpackage
does not support WiX 4
, although it is not written anywhere in plain text.
The solution is also clear, I install WiX 3
. However, here comes the "problem". WiX 3
requires an old version of .Net (3.5.1) or at least "Windows features .Net 3.5.1". However, this is what I want to avoid.
My question is, as of today, is there a way to directly use WiX 4
with jpackage
?
As of Java 23, the jpackage tool only supports WiX 3. The command line tools of WiX were reorganized in version 4, and so jpackage can no longer find light.exe
and candle.exe
(if I'm not mistaken, those two tools no longer exist as separate executables).
There's an enhancement request: JDK-8319457 - Update jpackage to support WiX v4 and v5 on Windows. The bug page says it has been fixed for Java 24, which is set to release on March 18, 2025. I'm not sure if there are any plans to backport the fix (e.g., to Java 17 and 21).