String getJavaHome(String version)
{
def stdout = new ByteArrayOutputStream()
exec {
commandLine "/usr/libexec/java_home", "-v", version
standardOutput = stdout;
}
return stdout.toString().trim()
}
retrolambda {
jdk System.getenv("JAVA8_HOME") ?: getJavaHome("1.8")
oldJdk System.getenv("JAVA7_HOME") ?: getJavaHome("1.7")
// ...
}
source : https://gist.github.com/Takhion/5c0f6c0c5aba9db5a488
沒有留言:
張貼留言