Question about bundling custom OpenJDK

Last week I have finally decided to upgrade to Java7. I downloaded the small online installation package, but it was unable to download anything. OK, so I downloaded the offline version. Ever since I can’t run ANY applets (it’s not security policy, they just crash).
After the big anti Java news campaign these last months, many security issues, recommendation of uninstalling Java and the permanent “it’s slow” dogma this last fail made me really worried.

So I started to look around on bundling my own OpenJDK JRE. I have come across some Cas’ posts on couple of sites and basically did the same as he did with OpenJDK. The JRE is now only 6MB. The performance level is little lower but otherwise my pet project runs nicely (true I tested it only on my machine).

My question is: is it OK to bundle such modified JRE? I know that Cas claims no one cares, and he is doing it with the Oracle/Sun JRE for years. Still, is it a gray area or is it 100% legit?

Thanks.

I want to know the answer too. Near on future I want to release desktop game.

I am on linux and compile my libgdx projects with openJDK. Bundling JRE seems good, many people uninstall it after that java exploit issue.

its certainly legal to package a non-modified openjdk jre - the other stuff might too

shrinking the jre isnt necessary anyway…

I think that ~80MB is still a lot. Recently I got Legend Of Grimrock and the whole installation is 400MB, and that is a pretty popular game with lot of content. Netbeans is 80MB (Java SE only).
So if I want someone to try just a demo or an alpha, requiring them to download additional 90MB could make a difference. I know that I would raise eyebrows.
In my current situation it would by 7MB vs 90MB.

You can modify OpenJDK as much as you want! You can also redistribute the Oracle build, and can remove certain things - there’s a document available somewhere. On my phone so you’ll have to Google it! :wink:

The Oracle JRE is probably the way to go on Windows, as it’s not easy finding an up to date OpenJDK. More sceptical of need for bundling on Linux - just distribute as a package with dependencies.

I did some research on this topic. Following this document it is OK to exclude some parts of Oracle JRE when you are redistributing it as a private application runtime. But modifying the jars (rt.jar) is prohibited. I’m using this for my conclusion.

On other hand OpenJDK is GPL v2 with Class path exception which means if I modify the source and build a smaller binary, I just have to provide the modified source. But It is hard to find anything about modifying the binaries. I suppose that by providing information that this is a derivative work, made by removing stuff it should be legit (maybe providing scripts used in the process).

Still if anyone have some interesting links or real life experience, please share :).

Hi

You can use OpenJDK under Windows, some developers provide unofficial builds on Github. I was very sceptical in the past but nsigma is right. You can remove what you want from OpenJDK. Some members of the JogAmp Foundation and of other organizations are still discussing about distributing OpenJDK + missing features to make it work in desktop and embedded environments. For example, it is possible to use NetX under Windows as OpenJDK itself doesn’t contain Java Web Start. OpenJDK under GNU Linux relies on Icedtea-web which provides Icedtea Web Start.

First of all: No. We talked about this a lot on this forum, and 5 years ago maybe, but today, no.

Secondly after you package it into an exe setup file or whatever archive, it shrinks to ~20mb

Ah, interesting! https://github.com/alexkasko/openjdk-unofficial-builds When I last looked (~9 months ago) it was hard to find any actual up-to-date builds.

I should frame that! :wink: For someone so avid a proponent of GPL on here, I was somewhat surprised at your scepticism about the rights it gives you.

Mind you, a credit on bug 698 for all the nagging and links I had to furnish you with would have been nice! ;D

Done:
https://jogamp.org/bugzilla/show_bug.cgi?id=698#c6

Thank you, really appreciate it. I’m happy to see such good responses on this topic.

[quote]First of all: No. We talked about this a lot on this forum, and 5 years ago maybe, but today, no.
[/quote]
As for the “size doesn’t matter" issue, there are stores that will charge you for the size of your content (they are paying the 3G traffic) and you have to scale your price (and still be able to compete). So this will be another place where this myth doesn’t apply ;).

That was meant as a tongue-in-cheek dig, but thank you. :slight_smile:

Some info I put together:
https://code.google.com/p/libgdx/wiki/BundlingJRE

Looks great! Unfortunately, I fear this may cause an issue soon - https://github.com/blog/1302-goodbye-uploads

JDK8 has a new tool “jdeps” (dependency checker, which I’ve never used) which is part of the new (and in progress) profile based builds which should spew out a minimal list of classes…other than those that can’t be statically determined…dynamically loaded/generated.

http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-November/012485.html

I don’t know what a tongue-in-cheek dig is, I will have to translate that into my mother tongue.

Ah, yes, sorry - a very English phrase. Done in a joking way - hence the big smiley. I wasn’t that bothered about it! :smiley:

Will you be adding the Mac and Linux examples for packaging the jre with an app soon? Also you link to launch4j for windows, is there any similar program for Mac and Linux?

If you mean Launch4j that runs on Macs and Linux, yes Launch4j has versions for Mac in Linux. If you mean a program that creates executables for Mac and Linux, not that I’m aware of. However creating an executable for Macs is as simple as copying a jar into a .app structure (which is basically just a folder with executables and resources in it). For Linux a shell script is usually used to launch a .jar, as has been mentioned in this thread. For example, I simply use an ant build script to create a runnable .jar (this is just generic and will run on any OS that supports Java), then run Launch4j on that jar to get a Windows .exe, and finally copy the jar into a prebuilt .app file structure.

Not sure what the best place is to host them. For Mac you create a .app directory and put a bunch of files in just the right place. For Linux you include a .sh script and tell them to figure it out on their own. :wink: You can look at Spine or Droid Assault and even steal the .app and .sh files.