"jpackage -t msi" - Package for Windows

This section provides a tutorial example on how to use 'jpackage -t msi' command to generate a binary distribution package from Java application JAR file in *.msi format for Windows computers. But 'jpackage' requires a third-party tool, WiX, to work.

If you want to create a binary package in *.msi format for my macOS computer with the "jpackage" tool, you need to try it on a Windows computer.

1. Compile and create a JAR file for my Hello.java application.

herong> javac Hello.java

herong> jar -c -f Hello.jar Hello.class

herong$ dir
2020/11/15  21:30               416 Hello.class
2020/11/15  21:31               736 Hello.jar
2020/11/15  21:29               112 Hello.java

2. Create a binary package in *.dmg format with the "jpackage -t msi" command.

herong$ jpackage -t msi -n Hello -i . --main-jar Hello.jar --main-class Hello

WARNING: Using incubator modules: jdk.incubator.jpackage
Cannot find WiX tool (light.exe, candle.exe)
From https://wixtoolset.org, download WiX 3.0 or higher, then add it to PATH.

Too bad. "jpackage" requires a third-party tool, WiX, to work on Windows computers.


Table of Contents

 About This Book

 Java Tools Terminology

 Java Tools Included in JDK

 javac - The Java Program Compiler

 java - The Java Program Launcher

 jar - The JAR File Tool

 jlink - The JRE Linker

 jmod - The JMOD File Tool

 jimage - The JIMAGE File Tool

jpackage - Binary Package Builder

 jpackage - What Is It

 "jpackage -t dmg" - Package for macOS

 "jpackage -t pkg" - Package for macOS

"jpackage -t msi" - Package for Windows

 javadoc - The Java Document Generator

 jdeps - The Java Class Dependency Analyzer

 jdeprscan - The Java Deprecated API Scanner

 jdb - The Java Debugger

 jcmd - The JVM Diagnostic Tool

 jconsole - Java Monitoring and Management Console

 jstat - JVM Statistics Monitoring Tool

 JVM Troubleshooting Tools

 jhsdb - The Java HotSpot Debugger

 jvisualvm (Java VisualVM) - JVM Visual Tool

 jmc - Java Mission Control

 javap - The Java Class File Disassembler

 keytool - Public Key Certificate Tool

 jarsigner - JAR File Signer

 jshell - Java Language Shell

 jrunscript - Script Code Shell

 Miscellaneous Tools

 native2ascii - Native-to-ASCII Encoding Converter

 JAB (Java Access Bridge) for Windows

 Archived Tutorials


 Full Version in PDF/EPUB