1

I found that Packr is the best tool to use for creating an executable file for my Java application on Linux. The executable works perfectly on Linux, but i have a question about this tool:

The tool forces me to embed JRE with the output folder causing big output size for my application. Can i create the executable without embedding JRE with it?

Brad
  • 4,457
  • 10
  • 56
  • 93
  • 1
    Java applications can't run without a JRE...unless you want to distribute a JAR and require that everyone that installs your application have the JRE installed, bundling the JRE in your executable is the only other real option. – Makoto Jan 01 '19 at 07:12
  • 1
    There has to be a JRE involved somewhere, and if you're not bundling the JRE then there's no point in not just distributing a jar. – chrylis -cautiouslyoptimistic- Jan 01 '19 at 07:25
  • I am aware of course that JRE is needed to run Java applications, but none of my users had problems downloading and installing JRE manually, so i see no need to bundle a JRE with my application. I just want to have an executable with my application to be user friendly for Linux users, just like an *.exe file in Windows operating system. – Brad Jan 03 '19 at 07:49

1 Answers1

0

If you are using java 9 or above you can use jlink to create an image that only contains the required jre modules and therefore will likely give you a smaller distributable. There's a tutorial here

stegzzz
  • 407
  • 4
  • 9