Skip to content

Commit 4883d41

Browse files
committed
Add warning for Java 7
1 parent 14566d3 commit 4883d41

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Core/src/main/java/net/minecrell/serverlistplus/core/ServerListPlusCore.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@ public ServerListPlusCore(ServerListPlusPlugin plugin) throws ServerListPlusExce
8282

8383
getLogger().log(INFO, "Starting...");
8484

85+
try {
86+
if (Float.parseFloat(JAVA_CLASS_VERSION.value()) < 52.0) {
87+
getLogger().log(WARN, "You're using Java 7 or lower. Keep in mind future versions of ServerListPlus " +
88+
"may require Java 8 or higher. Java 8 contains various improvements, especially regarding " +
89+
"performance. If possible, please upgrade as soon as possible.");
90+
}
91+
} catch (NumberFormatException ignored) {
92+
getLogger().log(WARN, "Failed to detect Java version. If you're using Java 7 or lower, keep in mind " +
93+
"future versions of ServerListPlus may require Java 8 or higher. Java 8 contains various " +
94+
"improvements, especially regarding performance. If possible, please upgrade as soon as possible.");
95+
}
96+
8597
// Print some information about the environment
8698
getLogger().log(REPORT, Helper.joinLines(
8799
"Plugin Information:",

0 commit comments

Comments
 (0)