There are multiple minification and obfuscation frameworks out there. One has a greater compression ratio then the other, but for me the most well know ones are probably:
- Dojo Shrinksafe - Rhino based compressor from the Dojo Toolkit
- YUI Compressor - Rhino based compressor by Yahoo
- JSMin - a whitespace compressor by Douglas Crockford
The implementation of this reader was quite simple and if you're interested, you can get the source here. Do keep in mind that you will have to have the JSMin.java file also on the classpath, otherwise it wil not work.