Skip to content

Commit

Permalink
SPIGOT-7839: Remove redundant Java version checks
Browse files Browse the repository at this point in the history
  • Loading branch information
md-5 committed Jul 20, 2024
1 parent 2c12b21 commit 894682e
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/main/java/org/bukkit/craftbukkit/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,21 +162,10 @@ public static void main(String[] args) {
}

float javaVersion = Float.parseFloat(System.getProperty("java.class.version"));
if (javaVersion < 61.0) {
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 > 66.0) {
System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 22 is supported.");
return;
}
String javaVersionName = System.getProperty("java.version");
// J2SE SDK/JRE Version String Naming Convention
boolean isPreRelease = javaVersionName.contains("-");
if (isPreRelease && javaVersion == 61.0) {
System.err.println("Unsupported Java detected (" + javaVersionName + "). You are running an outdated, pre-release version. Only general availability versions of Java are supported. Please update your Java version.");
return;
}

try {
// This trick bypasses Maven Shade's clever rewriting of our getProperty call when using String literals
Expand Down

0 comments on commit 894682e

Please sign in to comment.