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?

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.

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.

Quote

...(i) you distribute the Redistributables complete andunmodified, and only bundled as part of Programs, (ii) the Programsadd significant and primary functionality to the Redistributables,(iii) you do not distribute additional software intended to supersedeany component(s) of the Redistributables (unless otherwise specifiedin the applicable README file), (iv) you do not remove or alter anyproprietary legends or notices contained in or on theRedistributables, ...

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 .

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.

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.

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 .

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.

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.

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?

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. You can look at Spine or Droid Assault and even steal the .app and .sh files.

like I have a structure, a private jre, a shell script or whatever and I want to make a DMG on mac / app whateverand on linux, to me personally, a .deb would be the greatest - with dependencies... then maybe you can even leave out the jre

so:- How to make a DMG / APP on mac- how to make a .deb

On windows I personally dont use launchj4, I always had problems, I export using Eclipse, create a batch which uses my private jre and calls my game and then use a batch to exe tool - and lastly NSIS for installer

Doh! I searched high and low on the internet for something to do exactly this, but failed. The answer is of course completely obvious now you point it out. Thanks! I'm going to update my code asap. There are a bunch of annoying crazy bugs caused by this.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org