[FIX] Java 17 detect

This commit is contained in:
Gravita 2021-10-13 14:38:38 +07:00
parent dabe2e8106
commit d9b03d3c6a

View file

@ -151,6 +151,15 @@ public static JavaVersionAndBuild getJavaVersion(String version) {
result.version = Integer.parseInt(version.substring(0, dot));
dot = version.lastIndexOf(".");
result.build = Integer.parseInt(version.substring(dot + 1));
} else {
try {
if(version.endsWith("-ea")) {
version = version.substring(0, version.length()-3);
}
result.version = Integer.parseInt(version);
result.build = 0;
} catch (NumberFormatException ignored) {
}
}
}
return result;