Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 4
    The "downvote" isn't mine - but, there are other answers that provide the OP's question, and they were posted some time ago. When posting an answer see: How do I write a good answer?, please make sure you add either a new solution, or a substantially better explanation, especially when answering older questions. Commented Nov 7, 2019 at 13:35
  • 12
    @iSahil this probably got downvoted because simply writing to standard error doesn't explicitly color anything. Many IDEs and consoles will interpret error messages and print them in red or similar, but that's not something you can rely on. Commented Nov 7, 2019 at 13:38
  • 2
    While this wasn't the direct answer to the question asked above, this was the answer I was looking for when searching for "java print in red console". Thus, I do feel like it has it's place on this page. Commented Jan 7, 2020 at 16:07
  • 2
    printing to a different output stream just for color will get you in a multitude of problems Commented Sep 6, 2021 at 9:56