0

I have created Java Swing application that i have exporter to runnable jar file. With the use of Launch4j (link) i have managed to wrap it in exe file. If JRE not installed on the PC it sends the user to JAVA site to download. My question if there any wrapper that installs JRE automatically without sending the user to site.

DanM
  • 1,500
  • 3
  • 23
  • 44
  • You can check out InstallAnywhere from Macrovision (now Flexera) http://www.flexerasoftware.com/products/installanywhere.htm. I think it has this capability. (Disclaimer: I am not affiliated with the company :)) – mazaneicha Oct 21 '12 at 14:30
  • *"..have managed to wrap it in exe file."* What about *nix & OS X? A Good alternative is `deployJava.js` for the JRE and [Java Web Start](http://stackoverflow.com/tags/java-web-start/info) for the app. installer (for all 3 major platforms). – Andrew Thompson Oct 21 '12 at 15:46

1 Answers1

1

I used launch4j to deploy a swing app like this too. I just put the JRE folder into the same folder as my exe and jar file. You can deploy a JRE with your application just in case you need to ensure it has the version it needs. So my application has its own folder with a JRE folder in it, other jar files my app uses, the exe and ini file for launch4j. I cannot remember if I told launch4j to use the JRE in that folder or not, but it has to know to use that local JRE.

Here's a link to another question where someone did the same thing and tell how they pointed to the JRE. Specify JRE in launch4j

Community
  • 1
  • 1
Logan
  • 2,299
  • 17
  • 20
  • This is very good solution for me! How do i tell my app to use the local JRE? – DanM Oct 21 '12 at 15:14
  • It looks like you set it up using the JRE tab in launch4j. You just have to point it to the JRE path you will be using. I found a link here to how someone else did it too. http://stackoverflow.com/questions/7071133/how-to-bundle-a-jre-with-launch4j – Logan Oct 21 '12 at 15:40
  • Glad I could help. I support an app that I used launch4j with, so I know what you're going through. I only have to update my jar file though when I change my app. The exe keeps working so I do not have to rebuild the exe each time, which is nice. – Logan Oct 21 '12 at 23:38
  • That is also thing i didn't thought about, i always wrapped to exe and erased the jar file. I is good idea to use "Don`t wrap, launch only" function and replace the jar. Thank you again. – DanM Oct 22 '12 at 07:50