Permalink
Browse files

fix #311: didn't recognize Java 9 version string

  • Loading branch information...
vladdu committed Nov 3, 2017
1 parent b5fb1c7 commit d33c88575402572f7eb119d29df151adf2530d34
Showing with 16 additions and 10 deletions.
  1. +16 −10 extras/org.erlide.jvmcheck/src/org/erlide/jvmcheck/JvmCheck.java
@@ -30,16 +30,22 @@ public static int getJavaVersion() {
if(versionSegments.length < 2) {
return -1;
}
String javaVersionStr = versionSegments[1];
try {
return Integer.parseInt(javaVersionStr);
} catch(NumberFormatException e) {
return -1;
}
}
@Override
// v<9: 1.8...
// v>9: 9.x...
String javaVersionStr = versionSegments[0];
try {
int v = Integer.parseInt(javaVersionStr);
if (v == 1) {
javaVersionStr = versionSegments[1];
return Integer.parseInt(javaVersionStr);
}
return v;
} catch (NumberFormatException e) {
return -1;
}
}
@Override
public void earlyStartup() {
final int javaVersion = getJavaVersion();

0 comments on commit d33c885

Please sign in to comment.