• Post Reply Bookmark Topic Watch Topic
  • New Topic

Jar to Exe?  RSS feed

 
Rus Corina
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I have an application which I want to make an executable out of. I am supposed to give it to a company and they prefere it in a .exe form. Can anyone help me and tell me how I can do this? I already made a jar out of it. Also, my application also has some externar jar imports (sql driver) which need to be included in the .exe file as well.
 
Stephan van Hulst
Saloon Keeper
Posts: 7992
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, two of the nicest programs I've run into for this purpose are exe4j and install4j. They're not free, but they're pretty great. I believe they can create a .exe wrapper that simply calls the .jar indirectly, or encapsulate the .jar into the actual .exe file. install4j can create packages that use a pre-installed JVM, or can bundle a JVM with the .exe. I don't know of reputable programs that compile Java to native code.

Personally I still think that the best option is to simply invoke the JVM through a separate process in the program itself, but sometimes you don't have a choice in the matter.
 
Rus Corina
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if they are not free, I can't really use them. It's just a small application, so it doesn't really have a point to buy the program. Can a jar file run even if Netbeans is not installed? I mean, can a jar file behave like an exe file, provided that a jdk is installed?
 
Stephan van Hulst
Saloon Keeper
Posts: 7992
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jars have nothing to do with NetBeans, or any other IDE. Their point is to bundle files together (they have the same internal format as Zip files do) and they can be made to execute a bundled class' main method. Take a look at the Jar Lesson in the Oracle tutorials: http://docs.oracle.com/javase/tutorial/deployment/jar/index.html
 
Rus Corina
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. Thank you. Then I guess that the jar is enough
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rus Corina wrote:OK. Thank you. Then I guess that the jar is enough


Note, however, that the JRE (the java executable and associated libraries) will have to be installed on the machine where you wish to run the jar.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!