Bundling Stripped Java 1.5 + Molebox?

I hope what I’m asking for isn’t wrong. I’ve read many, many posts on this topic already, so I have an idea of the controversy. Anyway I am making a game where I can go the new JET 4.0 or try to “condense” the JRE. JET is now Java 1.5 certified so thats good, but the final install will be about 20+ megs. I want to experiment with the Java 1.5 JRE to get the game at least half-size. I was wondering if there was a solid tutorial (step by step) on where/how/which parts to take out and what must be left in. I know about “rt.jar” but is there anything else? Also specific Molebox settings to get it working properly. It didn’t seem like Molebox could put any folders, so how do I add all those JRE subfolders?

My game is all software rendered, with 3rd party Joystick (JStick I think) and GAGETimer. It goes fullscreen and windowed (needs AWT?).

Any help or advice is appreciated. Thanks!

You would save alot of space if you ditch AWT and use LWJGL instead. The only problem is that it will require OpenLG drivers to run a software rendered game.

I managed to squeeze the JRE into 1.4MB (floppy!! ;D) after compressing. It was still able to launch a LWJGL 3d-engine. Just for fun.

Can’t use it, until I find money somewhere to buy MoleBox.

But you really have to get rid of AWT/Swing in your game to squeeze the last air out of the JRE, don’t forget to buy MoleBox. Molebox molebox molebox. grrr.

Is there an un-moleboxed, stripped JRE game out there where I can pry into. Also can someone post instructions on exactly what to take out and leave in, and anything else that needs to be known to do it?

The game I am working on has a trimmed down JRE and it’s not moleboxed (yet).

You can download it here: here

Under the install directory you will fined it in java\jre

Edit: It’s not 1.5 though, it’s 1.4.2.

Warning though: I have been told this breaks the license agreement, so it won’t be able to stay this way.

Thanks for the info. Its hard to know what to take out of the JAR file. Nice game!

You can automate that process making smart use of certain java.exe arguments… :wink: Just check out which options there are, and pick the one you think will give you the right information :-X

I took out almost everything outside of java.lang, java.net, and java.io - and I specially left in RMI too which is useful for so many things. The way I did it was run the game with verbose class load on, and then painstakingly went through rt.jar removing all the classes that weren’t in the list it printed out.

Cas :slight_smile:

Really?

I parsed output of the -verbose:class argument, made an app that reads rt.jar, and stores all ‘matches’ from the parsed output in new_rt.jar

Job done in 8 seconds.

Okay the verbose:class will definitely work out, so thats how its done! And the automated program to read the verbose:class output file, sounds like something to make public domain, hint hint. :wink:

make sure you add quite a few packages, which are loaded before it starts printing to screen

such as

sun.misc
java.lang
java.lang.reflect
java.util

find out by trial and error.

Ahh, there’s a bit more to it than that… there were some extra classes required by different locales which you don’t pick up doing it that way - so bang! It crashes in a Spanish locale. And I wanted a VM I could reuse a bit without having to do it for every game (at the expense of a few hundred kb) with a few things I didn’t always directly use.

Cas :slight_smile: