added documentation

This commit is contained in:
2023-09-26 16:29:51 +08:00
parent 07817f80f9
commit a6098174e3
8 changed files with 185 additions and 38 deletions

View File

@@ -85,6 +85,7 @@ class MainRunner {
ModuleLayer layer = controller.layer();
Module mainModule = layer.findModule(mainModuleName).orElseThrow(
() -> new IllegalStateException(String.format("Main module '%s' not found", mainModuleName)));
Thread.currentThread().setContextClassLoader(mainModule.getClassLoader());
Optional<String> mainClassOpt = Optional.ofNullable(mainClassName);
runner.accept(Optional.ofNullable(mainClassName)
.or(() -> mainModule.getDescriptor().mainClass())