Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a Java EXE [closed]

Tags:

java

I was following this tutorial: https://netbeans.org/kb/docs/java/native_pkg.html#tool

and I did everything exactly as they explained to make an EXE file from a Java project (not a JavaFX project), which is the first part of the tutorial. (the lower part is about JavaFX)

The EXE file is created, and I can install the application (by executing the EXE file). But when trying to run, it says: "JavaFX Launcher Error: unable to invoke main method".

Any ideas?

I supose its recognizing the java file as an JavaFX project file, so its looking for the method start(), but I have no idea how I would solve this.

like image 630
user2489690 Avatar asked Feb 25 '26 10:02

user2489690


2 Answers

There are a lots of stuffs which you can find for converting .jar to .exe
such as launch4j, exe4j etc.

Try exe4j which is a common third party software for converting .jar to .exe

See the screenshots of exe4j

like image 200
Nidhish Krishnan Avatar answered Feb 26 '26 22:02

Nidhish Krishnan


launch4j is the best tool i can suggest to you.
You can actually convert your jar to .exefile.
And you can add some effects to the exe file too like adding splash screen like that.

like image 35
anji Avatar answered Feb 26 '26 23:02

anji