I'm trying to use jpackage
to create an installer for my Java app. I'm on Windows 10 using OpenJDK 15.0.1. I can build an installer using
jpackage --input C:\MyApp --main-jar MyApp.jar
This basically works, but the installed application lacks resource files. According to the documentation, I should be able to build an app image, add my resource files to the image, then build the installer from the modified app image, as follows
jpackage --type app-image -n MyAppImage
copy <resource files> MyAppImage
jpackage --app-image MyAppImage --name MyAppInstaller
However, when I try jpackage --type app-image
the process never terminates, and I have to kill it with control-C. When I examine the MyAppImage
directory, it has a subdirectory app
, which more or less mirrors the contents of C:\MyApp
. Those contents include MyAppImage
, which recursively gets copied into the app
subdirectory, creating a potentially infinite set of directories: C:\MyApp\MyAppImage\app\MyAppImage\app\MyAppImage
...
If I manually delete app\MyAppImage
and try jpackage --app-image
, jpackage crashes with a java.io.IOException.
Has anyone else encountered this? What should I try?