Yui compressor is Yahoo! A small tool developed specifically for compressing JavaScript and CSS files. The operating system requires support from the JDK environment. To use this tool, install JDK and configure the environment variables of java_home.
JDK: http://www.oracle.com/technetwork/java/javase/downloads/jdk6-jsp-136632.html
JDK's java_home environment variable configuration method can take a look at this win7 configuration Java compilation environment, here will not be too much repeat.
After the JDK environment variables are configured, you can download Yui compressor. The installation of Yui compressor is much simpler. Open the downloaded compressed package and double-click Install. the CMD file is successfully installed, and a "process with yuicompressor" command is added to the right-click menu of the system, use this command on any JavaScript or CSS file to compress the file, as shown in:
Note that Yui compressor can only be compressed for files encoded as gb2312, GBK or gb18030 by default, if you want to compress the UTF-8 file you have to manually modify compressor. CMD file, replace the gb18030 with a UTF-8, You can compress the UTF-8 encoding file. Yui compressor has a high compression rate. A Javascript file is provided in the installation package for compression testing. The compression rate is as high as 50%.
From the rain night knife's blog: http://stylechen.com/yui-compressor.html#comment-182