Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
12.0
-
Windows 10
Description
Similar (if not completely same) with: https://github.com/JetBrains/intellij-community/commit/707cf1427f66beb24faa5b8193217e52a8bb85d1 issue. In IntelliJ IDEA case, a fix has been published for version 2020.1. Can be used as reference.
Basically, printf() and print() does not work until a newline, not even System.out.flush() will work. This only happens on Gradle projects, and when running through the IDE (does not happen to Maven/Ant). This does not happen to println() because it prints new line.
Quite a breaking stuff, impossible to accept user input on the same line through the console.
As an example to demonstrate the issue:
public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Please enter ABC: "); in.next(); System.out.printf("DEF: "); in.next(); System.out.println("GHI: "); in.next(); }
Output:
JAVA_HOME="C:\Program Files\AdoptOpenJDK\jdk-14.0.1.7-hotspot"
cd C:\repo\test-cli; ./gradlew --configure-on-demand -PrunClassName=Transaction.Transaction -x check runSingle
Configuration on demand is an incubating feature.
> Task :compileJava UP-TO-DATE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE> Task :runSingle
ABC
DEF
Please enter ABC: DEF: GHI:
GHI
BUILD SUCCESSFUL in 17s
2 actionable tasks: 1 executed, 1 up-to-date
A fix would be very appreciated, thank you.
Attachments
Issue Links
- is related to
-
NETBEANS-4453 Output window doesn't display System.out.print lines until newline is sent.
- Closed
- links to
- mentioned in
-
Page Loading...