Build a desktop jar or an exe file

Hello i learn this

But my ide version not have application section

Please help how to buil game jar or exe file?

There is a build button (the one with the cleaner and the hammer) next to the run for building, it builds a jar file on the dist directory…

1 Like

You are using Gradle, so those instructions don’t apply to you. But you are rightfully using Gradle instead of Ant for which the instructions are. Don’t change it :slight_smile:

You can do all kinds of fancy stuff (installers etc.) with Gradle, but this is out-of-the-box Gradle feature which I use:
Right click on the project, select Run Gradle → Tasks… and create task to create a distributable ZIP:

Then later on you can use it simply:

You should end up with .zip in \build\distributions.

You can Google Gradle and Netbeans separate or together to learn more advanced magic.


If you want to have a native installer for your target platform, jpackage is your friend - this is a standard tool in modern JDK versions.


Thanks i have zip file in /build/distributions
how to run it?

extract zip file
cd bin
and run sh file?

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: wildmagic/WildMagic has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(
	at Method)
	at java.lang.ClassLoader.loadClass(
	at sun.misc.Launcher$AppClassLoader.loadClass(
	at java.lang.ClassLoader.loadClass(
	at sun.launcher.LauncherHelper.checkAndLoadMain(

I update java and project run

Extract the ZIP, there should be BAT file for Windows and was it that sh file for *nix? And your error is that your registered Java (in Windows, registered in the path) is older than the one you used to compile your app.

1 Like

i have directories
–/game/main class
app.getAssetManager().registerLocator(“./assets”, FileLocator.class);

how to add /assets/ folder to build zip acrhive?

i move all assets to resouces folder

1 Like

Ah yeah, there is that if you have similar structure than my project. I added separate FileLocator for the distribution. I don’t necessarily think this is the best way to do this. But you can copy from: