diff --git a/Launcher/src/main/java/pro/gravit/launcher/runtime/client/ClientLauncherProcess.java b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/ClientLauncherProcess.java index aaf4c5be..22b1b843 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/runtime/client/ClientLauncherProcess.java +++ b/Launcher/src/main/java/pro/gravit/launcher/runtime/client/ClientLauncherProcess.java @@ -145,7 +145,22 @@ public void start(boolean pipeOutput) throws IOException, InterruptedException { if (params.profile.getClassLoaderConfig() == ClientProfile.ClassLoaderConfig.AGENT) { processArgs.add("-javaagent:".concat(IOHelper.getCodeSource(ClientLauncherEntryPoint.class).toAbsolutePath().toString())); } else if (params.profile.getClassLoaderConfig() == ClientProfile.ClassLoaderConfig.SYSTEM_ARGS) { - systemClassPath.addAll(ClientLauncherEntryPoint.resolveClassPath(new HashSet<>(), workDir, params.actions, params.profile) + Set ignorePath = new HashSet<>(); + var moduleConf = params.profile.getModuleConf(); + if(moduleConf != null) { + if(moduleConf.modulePath != null && !moduleConf.modulePath.isEmpty()) { + processArgs.add("-p"); + for(var e : moduleConf.modulePath) { + ignorePath.add(Path.of(e)); + } + processArgs.add(String.join(File.pathSeparator, moduleConf.modulePath)); + } + if(moduleConf.modules != null && !moduleConf.modules.isEmpty()) { + processArgs.add("--add-modules"); + processArgs.add(String.join(",", moduleConf.modules)); + } + } + systemClassPath.addAll(ClientLauncherEntryPoint.resolveClassPath(ignorePath, workDir, params.actions, params.profile) .map(Path::toString) .toList()); }