protected File getJavaExecutable()
            throws MojoExecutionException {
        final String javaHome = System.getenv("JAVA_HOME");
        if (StringUtils.isEmpty(javaHome)) {
            throw new MojoExecutionException("JAVA_HOME is not set, cannot continue");
        }
        final File java = new File(javaHome + File.separator + "bin" + File.separator + "java");
        if (!java.exists()) {
            throw new MojoExecutionException("Cannot find the java executable at: " + java.getAbsolutePath());
        }
        if (!java.canExecute()) {
            throw new MojoExecutionException("Found java executable is not executable, cannot continue");
        }
        return java;
    }