Embedded JVM for Windows Native Deployment seems viable

With more end users having no JVM installed on the windows platform, I have been investigating alternatives on providing a native executable version of my java application.

I have tried:

  1. Excelsior JET but I will not be able to convince my work to pay for a license :frowning:
  2. Java Native Compiler… but that is limited to java 1.5
  3. Launch4J to make a exe-jar wrapper + embed a 1.7 JRE… way too large even when compressed using LZMA ( > 44Meg ) and the license is such that you cannot remove unwanted components.

Then I found that Azul Systems provide a Windows binary of OpenJDK (called Zulu).
4. Launch4J to make a exe-jar wrapper + embed 1.7 Zulu JRE … getting better( ~ 17 Meg )
5. Launch4J to make a exe-jar wrapper + embed 1.7 Zulu JRE, but perform Pack200 on all the jars + batchfile to unpack200 the jars… better again!( ~ 12 Meg )
6. Launch4J to make a exe-jar wrapper + embed 1.7 Zulu JRE, but perform Pack200 on all the jars + batchfile to unpack200 the jars + perform lossless shrinking of the JRE dlls,gifs,exes,etc… ( ~ 11 Meg )

That seems quite reasonable… and that is without stripping any of the actual JRE functionality.

I believe JET is still having the charity deal, might want to check that out.

Also check out Packr if you haven’t seen it yet. It does some minimization, but badlogic is planning to do more I believe. Using OpenJDK (for licensing issues surrounding JRE stripping), you can also get ~11Mb jars IIRC, and I think that is without pack200 and other tricks. I still have yet to play with it, but I’m going to try it out soon.

We’re using OpenJDK on Mac and Linux to do just that. We’ve not bothered with using it for Windows because there’s no real need.

And also… 44mb suddenly too big to deploy? That’s … tiny. Times have changed!

Cas :slight_smile:

You also might want to check out JWrapper.

The deal runs until the end of May, but it’s the Standard Edition, which does not include Java Runtime Slim-Down.

Even with the small business discount? (Assuming your “work” is a small company.)

44 Meg = too big

Rage was too big with what 20-30GB. I’m hard pressed to find any game < 100mb on steam
2GB for a game is absolutely ok.

44megs… :smiley:

How does OpenJDK performance compare to Oracle’s JRE? (on Windows) I kind of have the assumption that it won’t be as good, but never bothered to test it.

Near-as-dammit the same I should think.

Cas :slight_smile:

Maybe you are right. And I am being a little too stingy but I guess I have always been embarrased about pushing Java over C++ and the like for a end product that was going to be a native executable on a system without java installed. The java version was always laughed at for being bloated.

But times have changed and doubling the size of the application is not the problem it used to be.

That being said, I do like the non-oracle-ness of the open jre windows port :slight_smile: makes things a lot easier for the license ****s at work :stuck_out_tongue_winking_eye:

And that the open jdk jre compresses down quite nicely without any real effort is icing on the cake!

oh wow… i did not know that n.a.z.i.s was worth of censoring! crazy!

btw in case you missed it, do check out Java 8’s Compact Profiles, there is a blog post about it here. Compact Profile 1 is suppose to be less than 14mb in size.

I dont see awt in any of the compact profiles… maybe I am blind.

seems odd that open jdk which has not been trimmed of standard jre functionality (i.e. include awt ) when just simily compressed using 7zip is 17meg… what does the oracle version has that openjdk does not?

Thanks for the reference to Packr. I did not find that in my investigations… looks like the tool that I would use

JWrapper can get the JRE down to 7 MB:

Hello World bundled with 1.5 JRE - around 7MB (windows)
Hello World bundled with 1.6 JRE - around 11MB (windows)
Hello World bundled with 1.7 JRE - around 16MB (windows)

Source: http://www.jwrapper.com/features.html

T:\Hello>dir hello-setup*.exe
   .  .  .
05/09/2014  11:15 AM         6,735,625 hello-setup-jrsd.exe
05/09/2014  11:22 AM        11,174,954 hello-setup.exe

32-bit Excelsior JET Pro 9.0 MP1, Java 1.7.0_40, with and without Java Runtme Slim-Down.

It is not there… JavaFX is the future, did not you know that?

I do not discount that, but there is a lot of existing java swing applications out there.

Maybe it was just my ignorance but I am quite happy to see that there are quite a few valid alternative solutions out there now that java for the end user client is pretty much dead for the avgerage joe.