Reprinted: https://blog.csdn.net/leiyong0326/article/details/78494115
First effect:
0. Principle:
The core is to make Eclipse's console support ANSI Escape Color - an international standard for using specific characters to represent colors . That is, let Eclipse's Console escape (Escape) the specific characters that represent the color, instead of outputting it directly. E.g:
- public class HelloColor {
- publicstaticvoid main(String [] args) {
- System.out.println("Hello \u001b[1;31mred\u001b[0m world!");
- }
- }
1. Install the ANSI Escape in Console plugin for Eclipse/MyEclipse:
You can go to the eclipse marketplace to search and download. If you can't find it, you can use the plugin I compiled and merge it with the plugins directory in the eclipse directory. Download address: http://download.csdn.net/download/leiyong0326/10112547
2. Restart the IDE, as shown below, it means success