I want to create a windows installer for my jar file. I don't want to have to install jre/jdk on the target computer I want to deploy to.
I tried out jpackage (part of Java 14) and it didn't work for me. I tried the following command:
jpackage --input target/ --name my_pkg --main-jar NtbnsProj.jar --main-class myJFrame --type exe --java-options '--enable-preview'
It generates a my_pkg-1.0.exe, but I can't get it to run.
At this point, I'm willing to try even third party tools. I've tried install4j with no success. Another website I found said to use install4j with Inno Setup Compiler. This was more complicated and didn't work either. I thought maybe WiX Toolset might work.
If someone could provide step by step instructions, especially if the solution involves install4j, as there are many different steps where you can miss something. I was using a newer version of install4j, and it didn't match the online tutorials and videos. The menu selections have changed significantly. Perhaps I need to use an older version of install4j.
See my related article: How do I package a java jar file to run on a Mac without JRE installed?