How to create exe for java program

I always had the same problem with java programs packed with jar. How to run them in friendly manner. The best example of this can be eclipse which is run from eclipse.exe but it is written entirely in java.

I search a lot for some program which would make this easy and I found it. It’s called JSmooth.

So I had my application called Ndsr in jar file ndsr.jar

First we need to run JSmooth.

Then go to tab Skeleton and choose Windowed wrapper

Put message which will be shown to user when appropriate JVM is not found on user’s machine.

Also check “Launch java app in the exe process.

Save configuration in folder where you have your application jar

Next go to application tab and click icon with ‘+’ to add this jar.

Then click on ‘…’ button next to Main class text field to choose main class (this should be done automatically if you have main class defined in manifest but isn’t)

Choose your main class from ‘Available Classes’ and click select

Go to Executable tab and put name of your application with exe extension

You can also choose icon but there are some problems with .ico files (another bug) and png files are very ugly resized.

I next post I will describe how to change/add icon in exe files.

Then we need to specify JVM version so we need to go to JVM Section tab

Put version in Minimum JVM Version field.

If you need any specific JVM arguments go to JVM Configuration tab

So we are ready to go. Just click icon with gear or go to Project > Compile in menu.


, , , ,

  1. #1 by AndroidResearch on March 9, 2012 - 23:36

    Thanks for sharing this info.
    Not everyday I’m in a need to convert a .jar into an .exe, but I keep this page as a reference.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: