Reputation: 83
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^
I am receiving the following error when running the script.
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 download WiX311.exe and tried putting it in the same folder as the jpackage.exe and in the same folder as the MAIN_JAR.jar and neither has solved this issue.
So my question is what is "the PATH" that I need to add it to in order to get this to package?
Upvotes: 4
Views: 8354
Reputation: 1640
I installed the wix with the command below:
dotnet tool install wix -g --add-source 'https://api.nuget.org/v3/index.json' --ignore-failed-sources
Then I checked if it was installed and if it was added to PATH.
> wix --version
4.0.0+8c757c0f
But the jpackage continues with the same error:
❯ jpackage --type exe --dest .\target\jpackage --input .\target\bundles\my-app --main-jar 'my-app-1.0-SNAPSHOT.jar' --jlink-options --bind-services --verbose
[10:45:06.832] Running candle.exe
[10:45:06.883] jdk.jpackage.internal.PackagerException: Error: Invalid or unsupported type: [exe]
at jdk.jpackage/jdk.jpackage.internal.Arguments.generateBundle(Arguments.java:694)
at jdk.jpackage/jdk.jpackage.internal.Arguments.processArguments(Arguments.java:565)
at jdk.jpackage/jdk.jpackage.main.Main.execute(Main.java:92)
at jdk.jpackage/jdk.jpackage.main.Main.main(Main.java:53)
[10:45:06.873] Can not find WiX tools (light.exe, candle.exe)
[10:45:06.881] Download WiX 3.0 or later from https://wixtoolset.org and add it to the PATH.
My JDK is version 20.
Upvotes: 3
Reputation: 11116
Download latest WIX Toolset (Link)
Install wix311.exe
Note:
Upvotes: 8
Reputation: 499
Path is an environment variable.
You need to run wix311.exe and then click on the install button. Then all the appropriate tools will be installed and added to PATH.
Upvotes: 3