diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy index ab1b20580a3..ec6fa8e202b 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy @@ -202,11 +202,15 @@ class BuildPlugin implements Plugin { /** Runs the given javascript using jjs from the jdk, and returns the output */ private static String runJavascript(Project project, String javaHome, String script) { + File jjs = new File(javaHome, 'bin/jjs') + if (jjs.exists() == false) { + throw new GradleException("Cannot find jjs binary in java installation at ${javaHome}. At least java 1.8 is required.") + } File tmpScript = File.createTempFile('es-gradle-tmp', '.js') tmpScript.setText(script, 'UTF-8') ByteArrayOutputStream output = new ByteArrayOutputStream() ExecResult result = project.exec { - executable = new File(javaHome, 'bin/jjs') + executable = jjs args tmpScript.toString() standardOutput = output errorOutput = new ByteArrayOutputStream()