gmarty/grunt-closure-compiler — pull request #47 by gfreeau (2014-08-19 22:08:21+00:00)
Title: Made the java binary location customizable

Closure compiler docs (https://code.google.com/p/closure-compiler/wiki/FAQ) recommend the use of 32bit JVM for performance improvements.

I was able to improve my project compile time from 70 seconds to 15 seconds by using their recommendations. The problem is the java binary is hard coded to use your system default.

This is not ideal because most people would be running a 64bit JVM and the 32bit JVM would only be used for a specific purpose, so trying to run a 32 bit JVM alongside a 64bit one would take a lot of tinkering.

With this patch you can specify this in the grunt task config:

```
{
javaBin: '/opt/jdk1.8.0_20/bin/java -client -d32',
closurePath: ...,
}
```

You can download any JDK and place it somewhere on the system and without setting any environment variables or editing anything etc, you can use it just for doing the compiling to gain the speed increase.