fix: [#465] don't start up the launcher when running on Java 16 or newer
This commit is contained in:
parent
3377b99bcb
commit
844b261bae
5 changed files with 27 additions and 2 deletions
2
.github/workflows/application.yml
vendored
2
.github/workflows/application.yml
vendored
|
@ -7,7 +7,7 @@ jobs:
|
|||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
java-version: ["1.8", "1.9", "1.10", "1.11", "1.12", "1.13", "1.14", "1.15", "1.16"]
|
||||
java-version: ["1.8", "1.9", "1.10", "1.11", "1.12", "1.13", "1.14", "1.15"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
|
|
3
.vscode/launch.json
vendored
3
.vscode/launch.json
vendored
|
@ -9,7 +9,8 @@
|
|||
"projectName": "ATLauncher",
|
||||
"cwd": "${workspaceFolder}/testLauncher",
|
||||
"preLaunchTask": "makeTestLauncherDirectory",
|
||||
"args": "--debug --debug-level 5 --disable-error-reporting --no-launcher-update"
|
||||
"args": "--debug --debug-level 5 --disable-error-reporting --no-launcher-update",
|
||||
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
|
|
|
@ -17,6 +17,7 @@ This changelog only contains the changes that are unreleased. For changes for in
|
|||
- Checking mods on CurseForge sometimes failing
|
||||
- Loading settings sometimes returning a NPE
|
||||
- Forge maven changing url
|
||||
- Don't start up the launcher when running on Java 16 or newer [#465]
|
||||
|
||||
### Misc
|
||||
- Remove integration files from being written [#462]
|
||||
|
|
|
@ -102,6 +102,19 @@ public class Launcher {
|
|||
OS.openWebBrowser("https://atl.pw/java8download");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
if (Java.isJava16OrAbove()) {
|
||||
LogManager.warn("You're using Java 16 or above which isn't supported by ATLauncher!");
|
||||
|
||||
DialogManager.optionDialog().setTitle(GetText.tr("Unsupported Java Version"))
|
||||
.setContent(new HTMLBuilder().center().text(GetText.tr(
|
||||
"You're using Java 16 or above which isn't supported by ATLauncher. You need to downgrade your Java in order to use ATLauncher.<br/><br/>The launcher will not start until you do this.<br/><br/>If you're seeing this message even after installing an older version, you may need to uninstall the newer version first.<br/><br/>Click ok to open the Java download page and close the launcher."))
|
||||
.build())
|
||||
.addOption(GetText.tr("Ok")).setType(DialogManager.ERROR).show();
|
||||
|
||||
OS.openWebBrowser("https://atl.pw/java8download");
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
public void loadEverything() {
|
||||
|
|
|
@ -151,6 +151,16 @@ public class Java {
|
|||
getLauncherJavaVersion(), getMinecraftJavaVersionNumber(), getMinecraftJavaVersion());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the user is using Java 16 or above.
|
||||
*
|
||||
* @return true if the user is using Java 16 or above else false
|
||||
*/
|
||||
public static boolean isJava16OrAbove() {
|
||||
int version = getLauncherJavaVersionNumber();
|
||||
return version >= 16;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the user is using Java 7 or above.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue