Java jpackage native packaging error: WiX tools not found

Troubleshooting Issue with jpackage Tool in JDK14 Early Access Build

I am using the beta jpackage tool (JEP 343) that comes with the JDK14 early access build.

I have run the following .bat script in Windows:

"%JAVA_HOME%/bin/jpackage" ^
--name NAME ^
--dest store/ ^
--input store/package/ ^
--main-jar MAIN_JAR.jar ^
--main-class library.MAIN_CLASS^

When running the script, I receive the following error:

WARNING: Using incubator modules: jdk.incubator.jpackage

Can not find WiX tools (light.exe, candle.exe) Download WiX 3.0 or later from https://wixtoolset.org and add it to the PATH. Error: Invalid or unsupported type: [null]

I have downloaded WiX311.exe and tried putting it in the same folder as the jpackage.exe and in the same folder as the MAIN_JAR.jar but neither has solved this issue.

My question is: what is “the PATH” that I need to add WiX 3.0 or later to in order to get this to package?

The PATH" refers to the system environment variable that contains a list of directories where executable files are located. To add WiX 3.0 or later to the PATH, follow these steps:

  1. Locate the directory where WiX is installed (for example, C:\Program Files (x86)\WiX Toolset v3.11).
  2. Open the Start menu and search for “environment variables”.
  3. Click on “Edit the system environment variables”.
  4. Click on the “Environment Variables” button.
  5. Under “System Variables”, scroll down to find “Path” and click “Edit”.
  6. Click “New” and enter the path to the WiX installation directory (for example, C:\Program Files (x86)\WiX Toolset v3.11).
  7. Click “OK” to close all windows and save the changes.

After adding WiX to the PATH, run the jpackage tool again and it should be able to find the WiX tools.