GH-1365 rework java version parsing and sorting

This commit is contained in:
Petr Mrázek
2016-01-02 00:35:54 +01:00
parent 5f57df8110
commit a008efd24e
23 changed files with 414 additions and 138 deletions

View File

@ -235,8 +235,12 @@ public class Utils
ZipFile zip = new ZipFile(source);
boolean applyHacks = false;
String[] javaVersionElements = System.getProperty("java.version").split("\\.");
int major = Integer.parseInt(javaVersionElements[1]);
String[] javaVersionElements = System.getProperty("java.version").split("[.\\-+]");
int major = Integer.parseInt(javaVersionElements[0]);
if(major == 1)
{
major = Integer.parseInt(javaVersionElements[1]);
}
if (major >= 8)
{
applyHacks = true;