开发者

How to strip down JVM to get the smallest install possible?

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 开发者_C百科JVM that is a much smaller install? My target platform is Windows.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜