Last active
February 2, 2023 15:18
-
-
Save Rogach/6f9639e3025ba744fb77b895c841acf4 to your computer and use it in GitHub Desktop.
searching for java8-openjfx build issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ext.javaBinary = "/usr/lib/jvm/java-8-openjdk/bin/java" | |
def inStream = new java.io.BufferedReader(new java.io.InputStreamReader(new java.lang.ProcessBuilder(ext.javaBinary, "-version").start().getErrorStream())); | |
try { | |
String line = inStream.readLine(); | |
while (line != null) { | |
if (line.contains("Runtime Environment (build ")) { | |
int ib = line.indexOf(" (build "); | |
if (ib != -1) { | |
String ver = line.substring(ib + 8, line.size() - 1); | |
project.ext.set("jdkRuntimeVersion", ver); | |
} | |
} | |
line = inStream.readLine(); | |
} | |
} finally { | |
inStream.close(); | |
} | |
if (!project.hasProperty("jdkRuntimeVersion")) throw new Exception("Unable to determine the version of Java in JDK_HOME"); | |
System.out.println(ext.jdkRuntimeVersion) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment