From abc990bded7ea87a3320e63c0dbd856a19c0fec3 Mon Sep 17 00:00:00 2001 From: Zaxar163 Date: Tue, 11 Jun 2019 11:41:22 +0300 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=90=D0=B3=D0=B5=D0=BD=D1=82=20=D0=BD?= =?UTF-8?q?=D0=B0=20VM=20=D0=BE=D1=82=D0=BB=D0=B8=D1=87=D0=BD=D1=8B=D1=85?= =?UTF-8?q?=20=D0=BE=D1=82=20HotSpot.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/pro/gravit/launcher/LauncherAgent.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Launcher/src/main/java/pro/gravit/launcher/LauncherAgent.java b/Launcher/src/main/java/pro/gravit/launcher/LauncherAgent.java index 0ff8845d..05581b5e 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/LauncherAgent.java +++ b/Launcher/src/main/java/pro/gravit/launcher/LauncherAgent.java @@ -10,6 +10,7 @@ import java.lang.management.ManagementFactory; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.jar.JarFile; import org.objectweb.asm.ClassReader; @@ -54,13 +55,14 @@ public static void premain(String agentArgument, Instrumentation instrumentation if (trimmedArg.contains("r")) rt = false; } } - try { - if (ManagementFactory.getOperatingSystemMXBean().getName().startsWith("Windows")) replaceClasses(pb, rt); - else replaceClasses(false, false); - } catch (Error e) { - NativeJVMHalt.haltA(294); - throw e; - } + if (System.getProperty("java.vm.name").toUpperCase(Locale.US).indexOf("HOTSPOT") != -1) + try { + if (ManagementFactory.getOperatingSystemMXBean().getName().startsWith("Windows")) replaceClasses(pb, rt); + else replaceClasses(false, false); + } catch (Error e) { + NativeJVMHalt.haltA(294); + throw e; + } } public static boolean isStarted() {