aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-18 10:15:21 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-18 10:31:46 -0700
commit39f0d3194698ab571936587278566edb2729796b (patch)
tree3389a1f022e7db79b8e18b961744c407d4bb9e11 /tools/shared.py
parent327b6f859e95be71e5613f24cc1c9d4f4b97c15f (diff)
sanity check for java
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/shared.py b/tools/shared.py
index fb41f7ee..ea382501 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -1,4 +1,4 @@
-import shutil, time, os, sys, json, tempfile, copy, shlex, atexit
+import shutil, time, os, sys, json, tempfile, copy, shlex, atexit, subprocess
from subprocess import Popen, PIPE, STDOUT
from tempfile import mkstemp
@@ -77,6 +77,11 @@ def check_sanity(force=False):
print >> sys.stderr, 'FATAL: Cannot find %s, check the paths in %s' % (cmd, EM_CONFIG)
sys.exit(0)
+ try:
+ subprocess.call(['java', '-version'], stdout=PIPE, stderr=PIPE)
+ except:
+ print >> sys.stderr, 'WARNING: java does not seem to exist, required for closure compiler. -O2 and above will fail.'
+
if not os.path.exists(CLOSURE_COMPILER):
print >> sys.stderr, 'WARNING: Closure compiler (%s) does not exist, check the paths in %s. -O2 and above will fail' % (CLOSURE_COMPILER, EM_CONFIG)