Remove Java version check once and for all (#7612)

Closes #7611
This commit is contained in:
Nassim Jahnke 2022-03-16 14:10:32 +01:00 committed by GitHub
parent 2d3e8f7729
commit f35a0ceb93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 22 deletions

View file

@ -1,20 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach@zachbr.io>
Date: Sat, 8 Feb 2020 18:02:24 -0600
Subject: [PATCH] Allow overriding the java version check
-DPaper.IgnoreJavaVersion=true
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 08f4ba483a6c61365310de6561b314e428a6b978..b07323de3587464b54c25fd9e079b3b50ed323da 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -191,7 +191,7 @@ public class Main {
}
if (javaVersion > 61.0) {
System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 17 is supported.");
- return;
+ if (!Boolean.getBoolean("Paper.IgnoreJavaVersion")) return; // Paper
}
try {

View file

@ -0,0 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <jahnke.nassim@gmail.com>
Date: Wed, 16 Mar 2022 13:58:16 +0100
Subject: [PATCH] Remove garbage Java version check
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 2695f047a2e3c7acb67487c2b547cfbd6d50c29c..69b7a11d423b1cd8560cd726dd2b9a2b203e7dfd 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -189,10 +189,6 @@ public class Main {
System.err.println("Unsupported Java detected (" + javaVersion + "). This version of Minecraft requires at least Java 17. Check your Java version with the command 'java -version'.");
return;
}
- if (javaVersion > 61.0) {
- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 17 is supported.");
- return;
- }
try {
// Paper start - Handled by TerminalConsoleAppender

View file

@ -336,7 +336,7 @@ index 6535d59e4fd04cce072de4d939b84e423b5ce52d..e8bb0ee58df4d175d39469555fb62acc
// Paper start // Paper start
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index b07323de3587464b54c25fd9e079b3b50ed323da..c579f586c9a2dcb6356b49f68591f61e0fa61b62 100644 index 69b7a11d423b1cd8560cd726dd2b9a2b203e7dfd..7a5e7e8a680ead5128fbf5829bc47704715b94bd 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java --- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -12,6 +12,8 @@ import java.util.logging.Level; @@ -12,6 +12,8 @@ import java.util.logging.Level;
@ -385,7 +385,7 @@ index b07323de3587464b54c25fd9e079b3b50ed323da..c579f586c9a2dcb6356b49f68591f61e
try { try {
options = parser.parse(args); options = parser.parse(args);
} catch (joptsimple.OptionException ex) { } catch (joptsimple.OptionException ex) {
@@ -261,8 +293,64 @@ public class Main { @@ -257,8 +289,64 @@ public class Main {
} catch (Throwable t) { } catch (Throwable t) {
t.printStackTrace(); t.printStackTrace();
} }