feat: use system classloader load jar
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
56152657c8
commit
dc66290f97
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>pw.yumc</groupId>
|
||||
<artifactId>MiaoScript</artifactId>
|
||||
<version>0.21.1</version>
|
||||
<version>0.21.2</version>
|
||||
<developers>
|
||||
<developer>
|
||||
<id>502647092</id>
|
||||
|
@ -8,7 +8,7 @@ import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
public class MiaoScriptAPI {
|
||||
public static final String VERSION = "0.21.1";
|
||||
public static final String VERSION = "0.21.2";
|
||||
private static String root;
|
||||
private static String libPath;
|
||||
private static ScriptEngine scriptEngine;
|
||||
|
@ -25,7 +25,7 @@ public class JarLoader {
|
||||
|
||||
private static void initReflect() {
|
||||
try {
|
||||
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||
ClassLoader loader = ClassLoader.getSystemClassLoader();
|
||||
Field theUnsafe = sun.misc.Unsafe.class.getDeclaredField("theUnsafe");
|
||||
theUnsafe.setAccessible(true);
|
||||
sun.misc.Unsafe unsafe = (sun.misc.Unsafe) theUnsafe.get(null);
|
||||
|
Loading…
Reference in New Issue
Block a user