mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-22 08:31:07 +03:00
[FEATURE] Print error for unsupported Java
This commit is contained in:
parent
29aee9dd30
commit
0ccef10a93
1 changed files with 9 additions and 0 deletions
|
@ -3,8 +3,10 @@
|
|||
import pro.gravit.launcher.client.RuntimeModuleManager;
|
||||
import pro.gravit.launcher.client.DirBridge;
|
||||
import pro.gravit.launcher.utils.DirWatcher;
|
||||
import pro.gravit.utils.Version;
|
||||
import pro.gravit.utils.helper.*;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
|
@ -92,6 +94,13 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep
|
|||
context.javaVersion = JavaHelper.JavaVersion.getCurrentJavaVersion();
|
||||
}
|
||||
|
||||
if(context.javaVersion.version < 17) {
|
||||
String message = String.format("GravitLauncher v%s required Java 17 or higher", Version.getVersion());
|
||||
LogHelper.error(message);
|
||||
JOptionPane.showMessageDialog(null, message, "GravitLauncher", JOptionPane.ERROR_MESSAGE);
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
context.executePath = IOHelper.resolveJavaBin(context.javaVersion.jvmDir);
|
||||
String pathLauncher = IOHelper.getCodeSource(ClientLauncherWrapper.class).toString();
|
||||
context.mainClass = "pro.gravit.launcher.LauncherEngineWrapper";
|
||||
|
|
Loading…
Reference in a new issue