mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-01 21:17:46 -05:00
Improve the outdated Java error message when syncing in idea.
This commit is contained in:
@@ -29,10 +29,15 @@ public class LoomGradlePluginBootstrap implements Plugin<PluginAware> {
|
||||
if (!isValidJavaRuntime()) {
|
||||
errors.add(String.format("You are using an outdated version of Java (%s). Java %d or higher is required.", JavaVersion.current().getMajorVersion(), MIN_SUPPORTED_MAJOR_JAVA_VERSION));
|
||||
|
||||
String javaHome = System.getenv("JAVA_HOME");
|
||||
if (Boolean.getBoolean("idea.active")) {
|
||||
// Idea specific error
|
||||
errors.add("You can change the Java version in the Gradle settings dialog.");
|
||||
} else {
|
||||
String javaHome = System.getenv("JAVA_HOME");
|
||||
|
||||
if (javaHome != null) {
|
||||
errors.add(String.format("The JAVA_HOME environment variable is currently set to (%s).", javaHome));
|
||||
if (javaHome != null) {
|
||||
errors.add(String.format("The JAVA_HOME environment variable is currently set to (%s).", javaHome));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user