Skip to content

Commit

Permalink
Merge pull request payara#164 from Pandrex247/FISH-396
Browse files Browse the repository at this point in the history
FISH-396 _JAVA_OPTIONS prevents Payara Server determining Java version for JVM options
  • Loading branch information
Pandrex247 committed Sep 10, 2020
1 parent 892660d commit bba8dcd
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2016-2019] [Payara Foundation and/or its affiliates]
// Portions Copyright [2016-2020] [Payara Foundation and/or its affiliates]

package com.sun.enterprise.admin.launcher;

Expand Down Expand Up @@ -912,13 +912,12 @@ private Optional<JDK.Version> getConfiguredJdkVersion(String javaExePath) throws
Process p = r.exec(javaExePath + " -version");
p.waitFor();
try (BufferedReader b = new BufferedReader(new InputStreamReader(p.getErrorStream()))) {
String line = b.readLine();
if (line == null) {
return Optional.empty();
}
Matcher m = JAVA_VERSION_PATTERN.matcher(line);
if (m.matches()) {
return Optional.ofNullable(JDK.getVersion(m.group(1)));
String line;
while ((line = b.readLine()) != null) {
Matcher m = JAVA_VERSION_PATTERN.matcher(line);
if (m.matches()) {
return Optional.ofNullable(JDK.getVersion(m.group(1)));
}
}
}
return Optional.empty();
Expand Down

0 comments on commit bba8dcd

Please sign in to comment.