-2

I made an application using Java and has its .jar file. All I want to do is convert that .jar to .exe so that it could be run on systems don't having Java installed. I searched the internet but found nothing except some stupid videos and softwares which claims to do so.

So, how can I covert .jar to .exe. Or is it possible at all?

Jay Godara
  • 178
  • 4
  • 11

3 Answers3

1

Well. There are many softwares which could do this. I personally recommend using JSmooth. Jar2Exe is also an alternative, but you will have to pay for it.

xezio
  • 11
  • 1
1

You can use exewrap.

exewrap features...

  • x64(64-bit) & x86(32-bit)
  • Window application (with splash screen)
  • Windows service
  • Console application
1

It is possible. First of all you need to have java runtime enviroment (JRE). Then build your application from your IDE to get the jar file. Open it to see whether it runs. If it fails to run most probably your application lacks a main class, so sort that out and then use launch4j to create the exe. After building the project, In netbeans the jar file is located in documents/netbeansprojects/"projectname"/dist/. Create a folder on your pc and copy the dist folder there. Also copy your jre inside the dist folder. Rename dist to bin. Open launch4j. On first tab, "output file" choose the folder that you have created and on file name write the name of your app with the .exe extension. On "jar" choose the jar file that you have copied into the newly created folder. You can also choose an icon for your app on the first tab. Move to second tab "classpath". Check the "custom classpath" check box. On "mainclass" choose the jar file that you have copied on the new folder. If your app uses any libraries a directory or directories will appear on the text area called classpath. Modify each directory by adding "bin/" at the start of the directory and click accept. If your app has no libraries just write bin on the edit item text area and click accept. Move to the jre tab and type the name of your JRE bundle at the bundled jre path field. There is a button at the top that looks like the settings button. Click on it select where the exe will be saved. Then type a filename for where a log will be created. On cliking save your exe is created

Javan kyalo
  • 11
  • 1
  • 2