mojo
|
 |
«
Posted
2013-03-23 10:36:23 » |
|
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.
|
|
|
|
|
ReBirth
|
 |
«
Reply #1 - Posted
2013-03-23 13:21:01 » |
|
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.
|
|
|
|
Cero
|
 |
«
Reply #2 - Posted
2013-03-23 13:37:37 » |
|
its certainly legal to package a non-modified openjdk jre - the other stuff might too
shrinking the jre isnt necessary anyway...
|
|
|
|
Games published by our own members! Check 'em out!
|
|
mojo
|
 |
«
Reply #3 - Posted
2013-03-23 15:11:44 » |
|
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.
|
|
|
|
|
nsigma
|
 |
«
Reply #4 - Posted
2013-03-23 15:16:40 » |
|
its certainly legal to package a non-modified openjdk jre
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!  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.
|
|
|
|
mojo
|
 |
«
Reply #5 - Posted
2013-03-24 08:37:53 » |
|
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. ... (i) you distribute the Redistributables complete and unmodified, and only bundled as part of Programs, (ii) the Programs add significant and primary functionality to the Redistributables, (iii) you do not distribute additional software intended to supersede any component(s) of the Redistributables (unless otherwise specified in the applicable README file), (iv) you do not remove or alter any proprietary legends or notices contained in or on the Redistributables, ...
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  .
|
|
|
|
|
gouessej
|
 |
«
Reply #6 - Posted
2013-03-24 13:33:49 » |
|
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.
|
|
|
|
Cero
|
 |
«
Reply #7 - Posted
2013-03-24 13:44:56 » |
|
shrinking the jre isnt necessary anyway...
I think that ~80MB is still a lot. 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
|
|
|
|
nsigma
|
 |
«
Reply #8 - Posted
2013-03-24 16:02:39 » |
|
You can use OpenJDK under Windows, some developers provide unofficial builds on Github.
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 was very sceptical in the past but nsigma is right.
I should frame that!  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!
|
|
|
|
|
|
Games published by our own members! Check 'em out!
|
|
mojo
|
 |
«
Reply #10 - Posted
2013-03-25 08:17:46 » |
|
Thank you, really appreciate it. I'm happy to see such good responses on this topic. 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  .
|
|
|
|
|
nsigma
|
 |
«
Reply #11 - Posted
2013-03-25 12:10:29 » |
|
That was meant as a tongue-in-cheek dig, but thank you. 
|
|
|
|
Nate
|
 |
«
Reply #12 - Posted
2013-03-25 12:56:09 » |
|
|
|
|
|
|
|
|
|
gouessej
|
 |
«
Reply #15 - Posted
2013-03-25 17:34:56 » |
|
That was meant as a tongue-in-cheek dig, but thank you.  I don't know what a tongue-in-cheek dig is, I will have to translate that into my mother tongue.
|
|
|
|
nsigma
|
 |
«
Reply #16 - Posted
2013-03-25 17:58:52 » |
|
That was meant as a tongue-in-cheek dig, but thank you.  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!
|
|
|
|
Sublixt
Senior Newbie 
|
 |
«
Reply #17 - Posted
2013-03-27 01:56:55 » |
|
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?
|
|
|
|
|
Z-Man
|
 |
«
Reply #18 - Posted
2013-03-27 02:15:55 » |
|
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.
|
|
|
|
|
Nate
|
 |
«
Reply #19 - Posted
2013-03-27 02:44:22 » |
|
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.
|
|
|
|
ReBirth
|
 |
«
Reply #20 - Posted
2013-03-27 03:16:44 » |
|
Geez we need real example here!
|
|
|
|
|
|
ReBirth
|
 |
«
Reply #22 - Posted
2013-03-27 12:22:12 » |
|
So the exe needs to be compiled? 
|
|
|
|
princec
|
 |
«
Reply #23 - Posted
2013-03-27 12:51:28 » |
|
Well, yeah, but you can do it with free tools, obviously. Cas 
|
|
|
|
ReBirth
|
 |
«
Reply #24 - Posted
2013-03-27 12:59:06 » |
|
To make sure it, Windows target can be targeted with launch4j running on all OS (not counting Solaris or Haiku  )
|
|
|
|
Roquen
|
 |
«
Reply #25 - Posted
2013-03-27 15:06:38 » |
|
I'm surprised not to see zeroing out of environment variables.
|
|
|
|
|
princec
|
 |
«
Reply #26 - Posted
2013-03-27 15:07:24 » |
|
How does one do that? Cas 
|
|
|
|
|
|
Cero
|
 |
«
Reply #28 - Posted
2013-03-27 17:17:05 » |
|
I would be interested too in how to make mac and linux deployments.
like I have a structure, a private jre, a shell script or whatever and I want to make a DMG on mac / app whatever and 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
|
|
|
|
princec
|
 |
«
Reply #29 - Posted
2013-03-27 18:36:49 » |
|
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. Cas 
|
|
|
|
|