Java SE 5 and 6 comes already with a packing tool called "pack200". This tool is able to compress already existing jar files which can be then used for network distribution. I compressed the rt.jar with the following command:
C:\Java\jdk1.6.0\jre\lib>pack200 -J-Xmx256m rt.jar.gz rt.jar
参数-J-X是必须的,否则你可能会收到一个OutOfMemoryError的错误,因为这工具本身也是用Java语言写的,来看看结果吧,神奇的结果:
Origin size: 43.8 MB
Compressed size: 5.81 MB
要解压的话可以使用工具"unpack200"
The tool pack200 is especially interesting for the distribution of WebStart applications to achieve faster download times. There is already one another well known sample - glassfish. In the second installation stage, glassfish unpacks internal libraries using the unpack200 tool...
认真的看看最后这段话便可知这工具有何用途:)
心情: 一般