[FIX] JAVA_HOME override

This commit is contained in:
Gravit'a 2023-04-15 17:40:34 +07:00
parent fc7f96d536
commit 76f8b4602c
3 changed files with 8 additions and 14 deletions

View file

@ -119,17 +119,6 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IO
ModuleEntity entity = new ModuleEntity();
entity.path = file;
entity.moduleMainClass = mainClass;
try {
Class<? extends LauncherModule> mainClazz = (Class<? extends LauncherModule>) classLoader.loadClass(entity.moduleMainClass);
entity.checkResult = server.modulesManager.checkModuleClass(mainClazz);
} catch (Throwable e) {
if (e instanceof ClassNotFoundException || e instanceof NoClassDefFoundError) {
logger.error("Module-MainClass in module {} incorrect", file.toString());
} else {
logger.error(e);
}
return super.visitFile(file, attrs);
}
entity.moduleConfigClass = attributes.getValue("Module-Config-Class");
if (entity.moduleConfigClass != null) {
entity.moduleConfigName = attributes.getValue("Module-Config-Name");

View file

@ -141,8 +141,12 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep
if (customJvmOptions != null) {
args.addAll(customJvmOptions);
}
if(context.useLegacyClasspathProperty) {
args.add(String.format("-Djava.class.path=%s", String.join(IOHelper.PLATFORM_SEPARATOR, context.classpath)));
} else {
args.add("-cp");
args.add(String.join(IOHelper.PLATFORM_SEPARATOR, context.classpath));
}
args.add(context.mainClass);
args.addAll(context.clientArgs);
LogHelper.debug("Commandline: " + args);
@ -170,6 +174,7 @@ public static class ClientLauncherWrapperContext {
public Path executePath;
public String mainClass;
public int memoryLimit;
public boolean useLegacyClasspathProperty;
public ProcessBuilder processBuilder;
public List<String> args = new ArrayList<>(8);
public Map<String, String> jvmProperties = new HashMap<>();

@ -1 +1 @@
Subproject commit 29ee5c6d804282bac17d526a185a41ee40ddd1da
Subproject commit 8adf9de6efe47bd820f756184f2a184e1d677dd8