0

I am programming following thing:

public static void main(String[] args){
System.err.println("Watch on youtube: Mickey en de stomende drol");
}

My output is:

Watch on youtube: Mickey en de stomende drol

Which seems ok but the font color of the output is red. It should be black. How do I make the output black?

Jonas Audenaert
  • 160
  • 2
  • 16

4 Answers4

5

This is due to your console, not Java code. The console is displaying stderr differently from stdout, to make it stand out a bit more.

In IntelliJ IDEA (which you mentioned in your comments), the setting is:

Preferences -> Editor -> Colors & Fonts -> Console error output

Change that to whatever color you want.

yshavit
  • 42,327
  • 7
  • 87
  • 124
4

you must use

System.out.println("Watch on youtube: Mickey en de stomende drol");

err is always red in default if you want change it you must change your ide setting

saman
  • 438
  • 3
  • 8
1

that is because you are printing an error you should use System.out.println()

Joe Doe
  • 141
  • 1
  • 3
1

The color of standard error is environment specific and nothing to do with your code. That said for various environment there are various ways :

For IntelliJ go to Settings -> Editor -> Colors & Fonts -> ConsoleColors

Change the colors as per your wish.

for unix console refer to How to set font color for stdout and stderr

for windows cmd console refer to How can i change the text color in the windows command prompt

Community
  • 1
  • 1
Uday Shankar
  • 844
  • 7
  • 20