diff --git a/closure_compiler.checks.inc b/closure_compiler.checks.inc
index 5e28bdb..68d4618 100644
--- a/closure_compiler.checks.inc
+++ b/closure_compiler.checks.inc
@@ -9,6 +9,6 @@
  * Returns whether java is installed and executable on the machine.
  */
 function closure_compiler_java_installed() {
-  $output = shell_exec('java');
+  $output = shell_exec('java 2>&1');
   return FALSE !== stripos($output, 'Usage');
 }
