Making some dangerous leaps here - assuming you are running a 'console' style program, command window, stdin and stdout? On Windows?
If so, you may be able to use
ANSI Control Characters. I haven't tried it from
Java, but it's just stdout so it ought to work.
This is very old-fashioned from the days of DOS Batch and GW-Basic - 1980s. Windows only, but free & easy.
Here's a
Text UIpackage I found on Google. Went looking for curses but couldn't find it for Java in a few seconds.