Having code like:
---
public class ConsoleTest {
public static void main(String... args) {
System.console().readLine("Hello!");
}
}
---
And running it like:
---
$ ~/tools/jdk/jdk-22/bin/java /tmp/ConsoleTest.java >/dev/null
Hello!
---
Obviously, the text has not been written to stdout, but rather was (presumably) written to stderr.
---
public class ConsoleTest {
public static void main(String... args) {
System.console().readLine("Hello!");
}
}
---
And running it like:
---
$ ~/tools/jdk/jdk-22/bin/java /tmp/ConsoleTest.java >/dev/null
Hello!
---
Obviously, the text has not been written to stdout, but rather was (presumably) written to stderr.
- relates to
-
JDK-8331708 jdk/internal/jline/RedirectedStdOut.java times-out on macosx-aarch64
- Resolved