Skip to content

Instantly share code, notes, and snippets.

@jasontedor
Created November 10, 2015 20:16
Show Gist options
  • Save jasontedor/f063959c34097d5f1add to your computer and use it in GitHub Desktop.
Save jasontedor/f063959c34097d5f1add to your computer and use it in GitHub Desktop.
More robust handling of jps executable on Windows
File jps
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
jps = getJpsExecutableByName("jps.exe")
} else {
jps = getJpsExecutableByName("jps")
}
if (!jps.exists()) {
throw new GradleException("jps executable not found; ensure that you're running Gradle with the JDK rather than the JRE")
}
commandLine jps, '-l'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment