Wednesday, March 11, 2009

Java to EXE

Most java programmers at some time or other feel that they must have a mechanism to convert their
java program to windows executable. Yes you have a jar format but having an exe file would certianly be much better
than sending a jar file to some one and asking them to run with javaw.

For a long time I searched for a perfect tool which would be able to convert my java program to exe. Most of the tools
were either paid or too clumsy to use. I dint want to install any thing on my comptuer.
Basically I was searching for an open source tool . I found one after searching for some time

It is an Open source tool named Janel. SO what exactly is Janel. Here is the introduction from its website

http://www.redskaper.com/

Janel is a free, Open Source Java native executable and launcher for Windows. Launch your Java application just like other Windows executables. Within the configuration file set the location of the JVM, any of the Java system properties such as classpath, and more. A choice of non-console and console applications is available. The process name is whatever you choose for your .exe file

The site has a very good explanation on how to use Janel to convert your java program to exe. But let me tell you in simple steps

After downloading Janel


Rename JanelWindows.exe to YourJavaProgram.exe.

Rename JanelWindows.lap to YourJavaProgram.lap. ( this is a text file)

Open the YourJavaProgram.lap file in notepad and change the following line

janel.main.class=package.YourJavaProgram

-Djava.class.path=lib\YourJavaProgram.jar


Now just double click on exe file to run your favorite java program.

0 comments:

Post a Comment