How can I print color in console? I want to show data in colors when the processor sends data and in different colors when it receives data.
A fairly portable way of doing it is with the raw escape sequences. See http://en.wikipedia.org/wiki/ANSI_escape_code
[edited for user9999999 on 2017-02-20]
Java doesn't "handle the codes", that's true, but Java outputs what you told it to output. it's not Java's fault that the Windows console treats ESC (chr(27)) as just another glyph (←).