refactor(instance): split launch module and compile java shim from source

This commit is contained in:
objz committed 2026-04-25 12:31:29 +02:00
1 parent edb8efd033
commit ce34a28776
5 files changed
+533 -136

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import java.lang.reflect.Method;
public class MclShim {
public static void main(String[] args) throws Exception {
if (args.length == 0) {
System.err.println("Usage: MclShim <mainClass> [args...]");
System.exit(1);
}
String mainClass = args[0];
String[] remaining = new String[args.length - 1];
System.arraycopy(args, 1, remaining, 0, remaining.length);
ClassLoader loader = ClassLoader.getSystemClassLoader();
Class<?> clazz = loader.loadClass(mainClass);
Method main = clazz.getMethod("main", String[].class);
main.invoke(null, (Object) remaining);
}
}