mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 03:31:15 +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();
|
ModuleEntity entity = new ModuleEntity();
|
||||||
entity.path = file;
|
entity.path = file;
|
||||||
entity.moduleMainClass = mainClass;
|
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");
|
entity.moduleConfigClass = attributes.getValue("Module-Config-Class");
|
||||||
if (entity.moduleConfigClass != null) {
|
if (entity.moduleConfigClass != null) {
|
||||||
entity.moduleConfigName = attributes.getValue("Module-Config-Name");
|
entity.moduleConfigName = attributes.getValue("Module-Config-Name");
|
||||||
|
|
|
@ -141,8 +141,12 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep
|
||||||
if (customJvmOptions != null) {
|
if (customJvmOptions != null) {
|
||||||
args.addAll(customJvmOptions);
|
args.addAll(customJvmOptions);
|
||||||
}
|
}
|
||||||
args.add("-cp");
|
if(context.useLegacyClasspathProperty) {
|
||||||
args.add(String.join(IOHelper.PLATFORM_SEPARATOR, context.classpath));
|
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.add(context.mainClass);
|
||||||
args.addAll(context.clientArgs);
|
args.addAll(context.clientArgs);
|
||||||
LogHelper.debug("Commandline: " + args);
|
LogHelper.debug("Commandline: " + args);
|
||||||
|
@ -170,6 +174,7 @@ public static class ClientLauncherWrapperContext {
|
||||||
public Path executePath;
|
public Path executePath;
|
||||||
public String mainClass;
|
public String mainClass;
|
||||||
public int memoryLimit;
|
public int memoryLimit;
|
||||||
|
public boolean useLegacyClasspathProperty;
|
||||||
public ProcessBuilder processBuilder;
|
public ProcessBuilder processBuilder;
|
||||||
public List<String> args = new ArrayList<>(8);
|
public List<String> args = new ArrayList<>(8);
|
||||||
public Map<String, String> jvmProperties = new HashMap<>();
|
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