Follow the Steps below to deploy your .jar application with an Bundled JRE runtime. I’m doing this so I can deploy on Steam as an .exe application
File > New Project > JME3 > Basic Game (with Ant) > Project Name : Basic Game
Clean and Build
Download Wix
Path variable
jpackage tool location:
C:\Program Files\Java\jdk-17\bin
I change directory so the file is created in a known place
cd C:\Users\redacted\Downloads\packager_MyGame\dist
Run this to create the file
jpackage --input C:\Users\redacted\Downloads\packager_MyGame\dist --main-jar MyGame.jar
Run this to create the file. But relative path (.)
jpackage --input .\ –main-jar MyGame.jar
Debugging Notes:
Process to stop:
Installer of Main (The program)
Stop this process so you don’t have to log off windows in order to stop the process. This is helpful to delete the .exe in order to re-do it.
VERY IMPORTANT
If you program is called Main.jar/Main.exe go to Control Panel > Programs and Features in order to uninstall.
If you go to Program Files\Main and just delete the folder. Windows will not know the program is uninstalled and you won’t be able to run the installer again. It will silently fail. And you might have to go and edit the Registry. (sad emoji)
References:
Oracle JPackage tutorial
Below is a similar tool. I helps reading the wiki so you get familiar with the terminology of this process.
References to Avoid:
These assume you are creating an application which has JavaFX integrated. Also they are about building from ant tasks. Which is not needed for a first time use.
Broken Steps in JMonkey:
JMonkey > Right Click Project > Application > Desktop
[True] Create Windows 64bit Application
[True] Bundle JRE with Applications
JMonkey > Right Click Project > Properties > Build > Deployment > Enable Native Packing Actions in Project Menu
JMonkey > Right Click Project > Package As
I believe the steps do not work because JPackage was introduced in Java 14 and not in Java 11.