Ensure that the `javaOptions` are set correctly, as `exec` is asynchronous.

Previously, the `java` command would execute on the next tick and update the
`javaOptions` array, which could occur prior to the invocation of the Closure
Compiler on the current tick. This has now been refactored into a separate
`getJavaOptions` function, which passes the `javaOptions` array to a callback.

`getJavaOptions` is defined lazily; after the first invocation, the options
are cached and passed to all subsequent callbacks. The callbacks are invoked
on the next tick for compatibility with `exec`.