views:

288

answers:

2

I have a Java app to deploy and want to deploy the JVM along with it (to simplify install). I want to have the JVM stripped down to only include the pieces the app needs to keep the distributable small. How can I strip down the JVM to bring the size down? Can this be done with the Java Kernel or is there some alternative to the Sun JVM that is a much smaller install? My target platform is Windows.

A: 

Here's three ideas:

  • Use GCJ to compile your application to machine code, then add what parts of the classpath that you need.
  • Download Kaffe, and strip out parts that you don't need.
  • Grab the Java source code, and strip out parts that you don't need.

Good luck.

Chip Uni
+2  A: 

I think your requirements are mixed up: deploying the JVM with an app simplifies your job because you don't have to worry about JVM versions - but can be a considerable annoyance to users who don't want to have dozens of JVMs installed just to make programmers' jobs easier. Shouldn't you worry about that just as much as about distribution sizes?

I'd say that the best you can do is to use the Deployment Toolkit JavaScript to deploy your application via Java WebStart and specify a Java Kernel install. This makes sure a new JVM is installed only when actually required. The rest of the time it doesn't have to install anything except your app - the best possible case.

Michael Borgwardt
It's more so that for people, say like my mom, who wont understand why the program they're trying to install is asking for this Java thing. If I can use something very small for the included JVM, then I don't have to worry about users having to try to manage the app + JVM install.
Jeremy Raymond
I don't see how the size has anything to do with the ease of installation.
Michael Borgwardt