summaryrefslogtreecommitdiffstats
path: root/depends
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-01-02 00:35:54 +0100
committerPetr Mrázek <peterix@gmail.com>2016-01-02 00:35:54 +0100
commita008efd24e81441a23ff3e81320ac3522251327e (patch)
treef73886925814cc4cfb397be9f8342f7963d8f8d7 /depends
parent5f57df81109d268c79b34aac799fc7694ec5882a (diff)
downloadMultiMC-a008efd24e81441a23ff3e81320ac3522251327e.tar
MultiMC-a008efd24e81441a23ff3e81320ac3522251327e.tar.gz
MultiMC-a008efd24e81441a23ff3e81320ac3522251327e.tar.lz
MultiMC-a008efd24e81441a23ff3e81320ac3522251327e.tar.xz
MultiMC-a008efd24e81441a23ff3e81320ac3522251327e.zip
GH-1365 rework java version parsing and sorting
Diffstat (limited to 'depends')
-rw-r--r--depends/launcher/org/multimc/Utils.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/depends/launcher/org/multimc/Utils.java b/depends/launcher/org/multimc/Utils.java
index 1077065a..32cf7919 100644
--- a/depends/launcher/org/multimc/Utils.java
+++ b/depends/launcher/org/multimc/Utils.java
@@ -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;