2

I have made a nice little java file. I'm convinced that I have developed it to the maximum I can code. So, I was thinking, Minecraft is in java, and it has an exe for it, not a shortcut to the jar(That's the way I do it...), so how would I make an exe for my program? Plus, I have an icon, I put it into the bin and ran the program, and it worked. Where would I put it now?

3 Answers3

2

I've done this before and it isn't very effective. But here's a good place to start to figure it out for yourself: http://www.excelsior-usa.com/articles/java-to-exe.html

lildigiman
  • 137
  • 7
  • what do you mean 'not effective' –  Oct 23 '12 at 22:31
  • Well, you can do it. But I found it to be cheesy because I take the stance which that article suggests that "You should not, because that would kill the very purpose of Java." I can't remember exactly what I did but you could literally write an executable in c which just calls the jar. I don't know exactly how Minecraft's exe works, but minecraft's exe does call a Jar. If you look under .minecraft/bin it's named minecraft.jar – lildigiman Oct 23 '12 at 22:41
1

Take a look at Launch4J, that's what I use to make an .exe out of my Java .jar installers.

Ian Roberts
  • 120,891
  • 16
  • 170
  • 183
  • Do you think that this is effective? –  Oct 23 '12 at 22:33
  • @user1766728 What do you mean "effective" - it certainly works and I've been using it successfully for years, it can even prompt the user to download Java if they try to run the `.exe` on a system that doesn't have a JRE installed. – Ian Roberts Oct 23 '12 at 22:38
  • I've used Launch4j on an application with about 200,000 users and growing. My app includes a native lib (JOGL). No problems reported. – Gene Oct 23 '12 at 22:45
0

Personally, I use exe4j, it's not free but it will do what you want.

Most executable of this nature are just some kind of wrapper that calls Java on your behalf.

MadProgrammer
  • 343,457
  • 22
  • 230
  • 366