Although wrapping a jar in an Exe file doesn’t make any sense as it can be extracted easily using tools like WinRAR, you can still avail the benefits of it if you want to deploy your application on a client-side machine. Here, we have shared the steps through which you can convert jar to .exe using Launch4J for a project.

Before proceeding further, download Launch4J and install it on your computer or laptop. Once this app is installed on your PC, follow the below steps.

Note: Before you go ahead, make sure that you’ve completed your project, and the application runs fine without throwing any errors.

Convert JAR to EXE using Launch4J (Tutorial)

convert jar to exe using launch4j

  1. Click on new Configuration menu.
  2. When a popup window appears saying discard changes, click on yes
  3. Now Select the path to your output file (suppose you want to create an executable named project.exe in D:\ directory then your path to output file would be D:\project.exe )
  4. Select your project Jar File.
  5. Leave manifest Textfield as it is.
  6. Select your icon file for your executable. Exe file
  7. Leave other tabs on the basic tab as it is.
  8. Leave all fields in Classpath tab as it is.
  9. Leave all fields in Header tab as it is.
  10. From the single instance tab, select allow single instance checkbox and enter the process name for your application in the remaining two fields on single instance tab.
  11. In the JRE tab, Min JRE Version (Java Runtime version) for your application and leave all other fields as it is.
  12. Leave all fields in the set ENV variables tab as it is.
  13. Leave all fields in splash tab as it is.
  14. Enter your project version in version info tab.
  15. And finally, in Messages tab uncheck add custom messages.
  16. Now, click on the build wrapper menu so that your exe file will be created in the location you had specified in step 3.
  17. Your .exe file will now be generated.
  18. Done !!

If you don’t want to handle the pain of performing the above tasks, please use the plugins (Launch4J plugins) that are developed to automate this task on NetBeans or the Eclipse platform.

Apart from this software, there are many other tools that will help you to convert Jar to Exe file.

Google search results will show you many such tools and most of them are free to use. I Hope you’ve found this little tutorial useful.

5 COMMENTS

  1. Arshad

    Cake walk, clear and to the point post. thanks 🙂

  2. John Mickel Almeñe

    Same here its not working., what is the proper way of exporting project to jar file. is it export “Jar file” or “Runnable Jar file”? thanks.

    • The jar will be generated automatically each time your application compiles without throwing errors

  3. Jaishri

    I followed all the steps but my Application file is not running

    • Arshad

      @Jaishri – Please check whether jar is running properly from cmd as well as it should be executable jar

LEAVE A REPLY

Please enter your comment!
Please enter your name here