System.out.print("TEST") don't display on the console in IntelliJ Follow
Answered
I create a Gradle project, an type this code as below, but no display on the console.Please help me,thanks.
public static void main(String[] args) {
new Thread(new Runnable() {
@Override
public void run() {
while(true) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.print("TEST");
}
}
}).start();
}
Please sign in to leave a comment.
Hello,
What do you see in the "Run" tool window after executing your code? Do you see any error?
What Run/Debug configuration is in use?
Hello,
Without any error.
When I stop the program, it prints all thing.
This is my test code.
https://github.com/FanHongchuang/idea_example
This code work for me.
Thank you for the example and screenshots.
As I see, the issue is specific to Gradle and the similar question has been raised on official Gradle forum:
https://discuss.gradle.org/t/gradle-print-vs-println/21334
Moreover, IntelliJ IDEA's terminal outputs the string as predictable.
So, I recommend you to ask that question on StackOverflow, or Gradle forum.
I get it. Thanks.
Hello Konstantin Annikov ,
I came across the same problem and I posted this in detail in StackOverflow and then posted it again in a gradle forum as well. I suspect that the problem is with the IntelliJ's implementation as the problem doesn't seem to rise when gradle is used with other IDEs. It is not a big deal but still this bug is kinda irritating. It would be great if you could solve this. Thank you.
Please vote and follow this issue for updates: https://youtrack.jetbrains.com/issue/IDEA-184090