mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-22 16:41:46 +03:00
[FIX] JAVA_HOME override
This commit is contained in:
parent
fc7f96d536
commit
76f8b4602c
3 changed files with 8 additions and 14 deletions
|
@ -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");
|
||||
|
|
|
@ -141,8 +141,12 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep
|
|||
if (customJvmOptions != null) {
|
||||
args.addAll(customJvmOptions);
|
||||
}
|
||||
args.add("-cp");
|
||||
args.add(String.join(IOHelper.PLATFORM_SEPARATOR, context.classpath));
|
||||
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<>();
|
||||
|
|
2
modules
2
modules
|
@ -1 +1 @@
|
|||
Subproject commit 29ee5c6d804282bac17d526a185a41ee40ddd1da
|
||||
Subproject commit 8adf9de6efe47bd820f756184f2a184e1d677dd8
|
Loading…
Reference in a new issue