+ 5

How to compile java to exe

5th Nov 2016, 3:39 PM
Akhil
8 Answers
+ 12
By doing that you will ruin the purpose of Java. However, I upvoted your question inorder to more people see this. Java is cross platform, and when you compile the code it will give you .jar file which you can run on almost every OS. So, basically there is no logical reason to build an exe from Java code. So, dont :)
5th Nov 2016, 4:13 PM
Aaron Sarkissian
Aaron Sarkissian - avatar
+ 9
Java compile to .class files you however have a standalone package of .jar files for dist that will be platform independent with all the libraries it is basically a compression which Java understands however if you are interested in .exe there are many of .jar to .exe convertor they just add some instructions that can be run without jre but be highly cautious as there are many viruses which tell them to be such tools and then makes a bad program and you yourself run it and destroy. I recommend using .jar they can run anywhere execute faster and need no tools
5th Nov 2016, 4:15 PM
Sandeep Chatterjee
+ 2
Its java. Use .jar format. If you use IDE, try its project builders to create .jar file. If you want to compile from terminal use command: $ jar cfe myJar.jar myClass myClass.class
5th Nov 2016, 4:48 PM
Maksym ZieliƄski
Maksym ZieliƄski - avatar
+ 2
you can use an application called JSmooth, it packages the .jar into an .exe
5th Nov 2016, 5:29 PM
somestuffontheinternet
somestuffontheinternet - avatar
+ 1
You can use third party software.
5th Nov 2016, 4:14 PM
Puspa R. Rijal
Puspa R. Rijal - avatar
+ 1
If you're using Windows, IExpress would be useful, it's a packer, it also show options related to installation methods.
5th Nov 2016, 8:19 PM
M. de Vargas
+ 1
I would say that most easiest is Launch4J.
6th Nov 2016, 4:02 PM
npsonic
0
just use what is better 4 u, but i use launch4j
5th Jan 2017, 6:17 PM
joaquim matusse
joaquim matusse - avatar