0

Is it possible to print any System.out.println("Hello world"); with some specific color in eclipse.

I have tried System.err.println() but it is not synchronized and using the ANSI codes does not work. I guess this problem is specifically for the eclipse, any suggestions?

public static final String ANSI_BLACK = "\u001B[30m";
public static final String ANSI_RED = "\u001B[31m";
public static final String ANSI_GREEN = "\u001B[32m";
public static final String ANSI_YELLOW = "\u001B[33m";
public static final String ANSI_BLUE = "\u001B[34m";
public static final String ANSI_PURPLE = "\u001B[35m";
public static final String ANSI_CYAN = "\u001B[36m";
public static final String ANSI_WHITE = "\u001B[37m";

System.out.println(ANSI_RED + "This text is red!" + ANSI_RESET);
Kunj
  • 11
  • 5

0 Answers0