You are able to download it on Closure Compiler site or use this direct link compiler-latest.zip.
Because it is written in Java, so ensure that you have installed JDK 7+ on your machine before running it.
Let’s assume you want to compress
Now run the following command:
java -jar closure-compiler.jar --js myapp.js --create_source_map myapp.min.js.map --js_output_file myapp.min.js
The command will create you the below new files:
If you want to learn more about other flags and options for the Closure Compiler, execute the jar with the
java -jar closure-compiler.jar --help
ERROR - "arguments.callee" cannot be used in strict mode
A: That warning occurred because
arguments.callee is deprecated in ES5. So to solve that, you should add the
--warning_level=QUIET option to the command.