[ad name=”AD_INBETWEEN_POST”] I remember the day when I created a Tic Tac Toe game using Java Swing and packed it in an executable JAR file to distribute it among my friends. As few of my friends were not from computer background, they were unable to execute the JAR file. Hence I converted the JAR into EXE and send them the EXE.
It is sometime desirable to convert the JAR file in to EXE (executable) and distribute the EXE. Although the exe can be executed only in Windows environment, this will definitely affects the “platform independency” of a Java program. Still if you want to convert a JAR file in EXE then following tools are for you.
JSmooth .exe wrapper
JSmooth is a Java Executable Wrapper. It creates native Windows launchers (standard .exe) for your java applications. It makes java deployment much smoother and user-friendly, as it is able to find any installed Java VM by itself. When no VM is available, the wrapper can automatically download and install a suitable JVM, or simply display a message or redirect the user to a web site.
JSmooth provides a variety of wrappers for your java application, each of them having their own behaviour: Choose your flavour!
Download: http://jsmooth.sourceforge.net/
JarToExe 1.8
Jar2Exe is a tool to convert jar files into exe files.
Following are the main features as describe in their website:
- Can generate “Console”, “Windows GUI”, “Windows Service” three types of exe files.
- Generated exe files can add program icons and version information.
- Generated exe files can encrypt and protect java programs, no temporary files will be generated when program runs.
- Generated exe files provide system tray icon support.
- Generated exe files provide record system event log support.
- Generated windows service exe files are able to install/uninstall itself, and support service pause/continue.
- New release of x64 version, can create 64 bits executives. (May 18, 2008)
- Both wizard mode and command line mode supported. (May 18, 2008)
Download: http://www.brothersoft.com/jartoexe-75019.html
Executor
Package your Java application as a jar, and Executor will turn the jar into a Windows exe file, indistinguishable from a native application. Simply double-clicking the exe file will invoke the Java Runtime Environment and launch your application.
Download: http://mpowers.net/executor/
Advanced Installer
Advanced Installer lets you create Windows MSI installs in minutes. This also has Windows Vista support and also helps to create MSI packages in other languages.
Download: http://www.advancedinstaller.com/
Let me know other tools that you have used to convert JAR to EXE. And also comments/reviews about these tools.
If you read this far, you should follow me on twitter here.
You can also try Launch4j that is opensource and hosted on Sourceforge.
http://launch4j.sourceforge.net/
Can generate multi platform wrappers.
Launch4j is very good, but it has two disadvantages:
Its generated .exe file can be extracted (e.g. by winrar)
Doesn’t support passing variable parameters (e.g. file name)
However, it is suitable for most applications that don’t receive parameters
@Osama – Thanks for sharing your findings with Launch4j.. Very useful for users..
very nice thanks , i didn\’t knew these application do exist :)
You welcome Ali Lawati.
You missed Launch4J http://launch4j.sourceforge.net/
Hi Viral,
i found many of the tools for converting jar to exe.
Just see the links.
Its very good and helpful.
http://yuvadeveloper.blogspot.com/2009/03/convert-jar-files-to-exe.html
mast idea
Thank you very much
May try Excelsior JET
Nice post… Can we change the icon of the exe file using any of the above tools?
you can do this whit the limited time of the Jar2Exe Wizard 1.8 tool
I have tried most of the tools mentioned above. I found Inno Setup as the best tool for creating Setup exe files. That allows you to add icon for exe and also uninstallation support also there.
Thank You So Much! copacetic!!!
those r some vwey nice tools yet the problem persists in the fact that you need a JRE to start the exe files u created using these converters and its not always that easy for end users to install JRE.do u know of any program that converts jar into exe files that dont require a JRE environement to run at all?
Java can not run without JRE.
However, if not installed, it should prompt to download and install automatically.
@waddah, I understand it is not common that people install JRE on their system. But I am not aware of any way of running a JAR file without JRE!! This may not be good solution but you may want to make a prerequisite of installing a JRE before installing your Java software.
suggestive conclusion… wehehehe…. don’t try all just pick your most trusty p2p servers like mine….
Hello,
And is it possible to reverse again the .exe generated by laun4j into a .jar,
by exemple if i have converted a .jar into a .exe with launch4j and then i want to convert back this same .exe into .jar in order to find back my original .jar ?
Hi Viral,
ur posts are really good … thanks a lot :-)
just wanted to add about JRE stuff .. jsmooth allows to point to a local JRE folder which can be shipped along with our product .jsmooth is another OSS wrapper for jar files files.
(No installation required from user end).BUt that would add about 60mb to our distribution . Not really a problem if we are planning to distribute over a physical medium – Mem. Stick/CD/DVD
Best setup packing options for a jar from my experience is
IzPack + jsmooth
How to convert exe to jar?
nice I created my first exe just coz of u
thanks
You can use my JAR2EXE converter Beta 1 to convert them. Made using NSIS and tha exe files had even resources. Get it from http://transfer2pc.weebly.com/1/post/2010/05/jar-to-exe-converter-beta-1.html
the jae2exe key is not found and it is costly. does anybody have it?
sorry masked resources
pls how can i edit exe file… I’ve been lookn for executable file editor. Help Help me
how can i install in my pc… error code is 2755
We can easily convert jar to .exe or vice versa, through java IDE eclipse, we can do it in manually in matter of seconds, SAY NO TO SOFTWARE.)::
can u pls explain the steps in detail …
I’m using eclipse helios
mast idea is like the way u have code please regenerate the code and click on the right side of this your application and open with texteditor and simultaneously run the code with window media player you can get exe and jar file thanks alot for commment
I want a software that can convert EXE files to JAR extension. Please help me out
Thanks!
very very help full!!!!!!!!!!!
thank you very much!!!!!!!!!!!!!
@Dewang – Glad the tutorial helped :-) You welcome..
I want to make an exe of a jar in which I have used MySQL database.If there is any application creator which will also use MySQL [existing in localhost] and if then which one?
did you get an answer to your question?
Sir, I am curious what the widget you are using. Thank you sir forgive my english.
i am not able to make exe file in java plz help me
thx for all these information but all these solution (.exe) is not valid to connect to database (MySQL)…
can you help me or give me another another solution???
and thx
plzzzzzzzzz help me for these
……
help me to make .exe with of .jar with database (MySQL)… and thx for your time…i make .jar but is not connect to my database (MySQL)… can u help me about that????
and thx again
How to convert the executable jar file which is developed using IzPack to ‘.exe’?
can anyone please help me out….looking forward for replies…
Thanks
well, thanks for listing these applications. Is there a manual way to convert jar files to exe files without using any application.
I want a software that can convert EXE files to JAR extension. Please help me sir/mem
how can convert .exe file to .jar files
Hi,
I have created one html file including audio,video,text,image. I want to convert the file into jar file purpose of installing into mobiles….
is it possible or, u have any other idea. can u suggest me
hOW TO CONVERT A EXE FILE TO A JAR FILE
Thanks yaar. JSooth .exe wrapper worked very nicely for me. It solved all of my app distribution problems…
again, thanks a lot.
Dear Mr Patel,
I have downloaded a .jar file for my mobile. This is a “tanpura.jar” which is a music software. But the problem is that it has less sound (volume). The maximum is 20pt. even which is not at all audible.
Please advise can be edit this software (jar file) to increase the volume.
Please reply to my e-mail id.
Regards,
Suresh Kurup
plz tell me,How to convert jar file to exe file using dos command prompt?
easy way to create exe file through java executable file
JSmooth is garbage. It’s last public release was way back in 2007.
Also, Executor no longer even exists.
Your blog is always a great help….thanks Viral.
hello mr. I used “JarToExe 1.8” after visit this page, your blog. But when I try to oen the “.exe” file it shows me “Java runtime environment not found”, means its not working. Can you have any solution for this? please replay. thank you.
Thanks yaar. JSooth .exe wrapper worked very nicely for me. It solved all of my app distribution problems…
again, thanks a lot.
can you tell me how .exe convert in to .jar?
you are really awesome man thanks for the help
Hi, can you please tell me how can we wrap up SQL files with these? I mean if I am building an application with Java + SQL server, how will I wrap both of them together to make a installable package?
Thanks!
In my point of view about your question., you cannot pack both application and SQL server in one package unless the database you are using is embedded in your java application…
help me to make .exe with of .jar with database (MySQL) i badly need it
how i connect whole things with ur code ?
Thank you Viral,
Your information and tutorial, both are most helpful.
Hi,
These s/w very helpful to make exe , and also thnx to u to give info. about jar to exe but i have a prob in my exe.
Actually i m using mysql db so i can’t integrate in exe, i can’t make sql connection , how can do this???
Please help??
I wrote an application which takes an .xls file with account information (account nr., swift code) and generates another .xls file, where IBAN and BIC code are there.
The application works via an internet site (through AJAX controller), where it retrieves the IBAN and BIC with the help of account nr. and swift code (it takes some time until you’ve got the information). The output .xls is saved in the project directory ( writableWorkbook.write() ).
The application works from JDeveloper but does not work from .jar or .exe file (I wrapped the .jar-file with launch4j). Do you have an idea what the problem could be? Thx in advance!..
To all those who wish to embed a database – why not
simply use Apache Derby or H2 or HSQL or similar
java database?
HTH,
Paul…
hi, i create a program in jFrame with database
when i create it’s jar file it not support an mysql database.
plz help me regarding this problem.
After generating the exe, when i double click on it i am getting an error message like “The main class could not be found”.Could you suggest on resolving the same.
-balaji
Nothing works in your links. Why?
Can we use Apache Derby or H2 or HSQL?