Skip to content
This repository has been archived by the owner on Oct 16, 2019. It is now read-only.

Commit

Permalink
Merge pull request #29 from jGauravGupta/NP-44
Browse files Browse the repository at this point in the history
NP-44 Fix JAVA_VERSION property parsing for JDK 11
  • Loading branch information
jGauravGupta authored May 30, 2019
2 parents 033f6f7 + 90032f9 commit ab5e1c2
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,13 @@ public Version getJavaVersion() {
if(javaVersion == null && javaHome != null) {
try (BufferedReader bufferedReader
= new BufferedReader(new FileReader(new File(javaHome, "release")));) {
String version = bufferedReader.readLine();
javaVersion = JDK.getVersion(version.substring(version.indexOf("\"") + 1, version.lastIndexOf("\"")));
String line;
while ((line = bufferedReader.readLine()) != null) {
if (line.startsWith("JAVA_VERSION")) {
javaVersion = JDK.getVersion(line.substring(line.indexOf("\"") + 1, line.lastIndexOf("\"")));
break;
}
}
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
Expand Down

0 comments on commit ab5e1c2

Please sign in to comment.