August 29, 2016

Creating an Exechuteable GUI

Note: Before following this guide you may want to familiar yourself with making jars.

You should have the uberjar which can be created by following a guide I have written previously. Now you want to take it one step further and make the jar into an exe to distribute to different windows platforms. There is a few ways to go about it but I typically use launch4j.

After downloading Launch4j precede to the following steps...

Step 1:

Open it up and fill in the output file and Jar field as the following. The output file determines what the .exe file will be called. While the jar field is the uber-jar you select and the launch4j will use to create the .exe file.

image

Step 2:

After filling those fields switch to the header tab. Click on the GUI radio button unless you're using just console.

image

Step 3:

Click the JRE tab and enter Min JRE version as what minimum java you need to run the code. Also click the + property button by variables / registry field to add the EXEDIR property.

image

Now click on build wrapper which is the gear icon on top and it should build your .exe file!

Tags: Clojure Code Guide