Before writing anything, I shall mention that this information is taken from the Web. Special thanks to excelsior-usa.com. The motivation is: It took lot of time for me to understand the concepts. I am putting it in Question & Answers format to make the life of frustrated people much easier.
Java to executable here means an executable file which is created from Java source code. That executable file does not need any JVM/JRE to run.
Below is the list of ways you convert Java to Exe (which uses JVM)
a) Batch File
Create a batch file which runs your java program. E.g.
b) Executable Jars
You can compile your classes into jar file. In the manifest.mf file mention about the main class. Main-Class: MainProgram
c) Installation Packaging tools
Good Question. In most of the scenarios you would not want that. For most people, they want their Java could to be created as executable though it finally uses JVM only (mentioned above). You may want the native (AOT) compiler for the following reasons:
a) Security: You would want Java to Exe mainly for the security reasons. Any Java program which uses JVM can be decoded easily. This explains very well why the security is a concern.
b) Performance: Well, this is subjective / debatable. It was thought that native executable are faster and perform better, but the achievements of Virtual machines like hot-spot, etc gives competition to native executable.
There are not much options for Native Complications. Options are :
2. Excelsior – Jet