0

OK, I’m still a little overwhelmed by all the choices for deploying an application. My case is really simple. I have a Java program that’s now working in NetBeans on Win7. I want to run it on another Windows desktop that doesn’t have NetBeans.

The method presented here: https://netbeans.org/kb/docs/java/native_pkg.html produces a single .exe file that installs the application on the Win desktop. But, that file is huge because it includes all required portions of the JRE.

The method presented here https://netbeans.org/kb/articles/javase-deploy.html uses the JRE already installed on the Win desktop so the distribution is very small. But, it requires you to distribute both a .jar file and a lib folder.

So, finally, the question. Is there a method that uses the already installed JRE and only requires the distribution of one (small) file?

Thanks.

Greg Valvo
  • 1,069
  • 1
  • 9
  • 13
  • If i recall correctly, Netbeans has a `clean and build` function. This produces a `my-application.jar`. You can run this jar on any other machine with a compatible jre by running `java -jar my-application.jar`. This will only work if you do not use any external libraries and have a correctly formatted manifest file in your jar. If you do have external libraries, you can still do this if you package all external jars in one jar: http://stackoverflow.com/questions/183292/classpath-including-jar-within-a-jar – Ian2thedv Mar 27 '15 at 14:24
  • clean and build only means to empty the build folder before starting the build process. you will need to configure your project settings in order to include all dependencies in a single .jar file – Timothy Groote Mar 27 '15 at 14:26
  • @lan2thedv - Yes, I have an external library. I think that’s why the extra lib folder showed up. The discussion and “solutions” at http://stackoverflow.com/questions/183292/classpath-including-jar-within-a-jar are far too complex. I don’t know how to “configure your project settings in order to include all dependencies in a single .jar file” So, I guess I either look into izpack or bite the bullet and put both the .jar and lib folder in a .zip file and make the end user deal with both. – Greg Valvo Mar 27 '15 at 14:57

1 Answers1

0

Since that second option has everything you need to run the app (provided that a JRE is available), you can use that with a third party install packager like izpack

Timothy Groote
  • 8,614
  • 26
  • 52