Commits
md_5 authored 7c3ac942488
43 43 | boolean readOnly = Boolean.getBoolean("bundlerReadOnly"); |
44 44 | List<URL> extractedUrls = new ArrayList<>(); |
45 45 | readAndExtractDir("versions", outputDir, extractedUrls, readOnly); |
46 46 | readAndExtractDir("libraries", outputDir, extractedUrls, readOnly); |
47 47 | |
48 48 | if (mainClassName == null || mainClassName.isEmpty()) { |
49 49 | System.out.println("Empty main class specified, exiting"); |
50 50 | System.exit(0); |
51 51 | } |
52 52 | |
53 - | ClassLoader maybePlatformClassLoader = getClass().getClassLoader().getParent(); |
54 - | URLClassLoader classLoader = new URLClassLoader(extractedUrls.toArray(new URL[0]), maybePlatformClassLoader); |
53 + | URLClassLoader classLoader = new URLClassLoader(extractedUrls.toArray(new URL[0])); |
55 54 | |
56 55 | System.out.println("Starting server"); |
57 56 | Thread runThread = new Thread(() -> { |
58 57 | try { |
59 58 | Class<?> mainClass = Class.forName(mainClassName, true, classLoader); |
60 59 | MethodHandle mainHandle = MethodHandles.lookup().findStatic(mainClass, "main", MethodType.methodType(void.class, String[].class)).asFixedArity(); |
61 60 | mainHandle.invoke(argv); |
62 61 | } catch (Throwable t) { |
63 62 | Thrower.INSTANCE.sneakyThrow(t); |
64 63 | } |