Skip to content

Commit

Permalink
Default to old console if user has not set it
Browse files Browse the repository at this point in the history
This is done because the new JLine console
which is the default from JDK 23 (maybe even 22?)
causes a large regression in startup time due to
it loading a very large number of classes.

If users really want to use the new console,
they have to start the application with
`-Djdk.console=jdk.internal.le`

Fixes: #44471
Fixes: #44653
  • Loading branch information
geoand committed Nov 28, 2024
1 parent be0030f commit 88a0dce
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,17 @@ public synchronized static void uninstallRedirects() {
redirectsInstalled = false;
}

private static void checkAndSetJdkConsole() {
// the JLine console in JDK 23+ causes significant startup slowdown,
// so we avoid it unless the user opted into it
String res = System.getProperty("jdk.console");
if (res == null) {
System.setProperty("jdk.console", "java.base");
}
}

public static boolean hasColorSupport() {
checkAndSetJdkConsole();
if (Boolean.getBoolean(FORCE_COLOR_SUPPORT)) {
return true; //assume the IDE run window has color support
}
Expand Down

0 comments on commit 88a0dce

Please sign in to comment.