This question already has an answer here:
- Command line progress bar in Java 12 answers
Is there are easy way to implement a rolling percentage for a process in Java, to be displayed in the console? I have a percentage data type (double) I generated during a particular process, but can I force it to the console window and have it refresh, instead of just printing a new line for each new update to the percentage? I was thinking about pushing a cls and updating, because I'm working in a Windows environment, but I was hoping Java had some sort of built-in capability. All suggestions welcomed! Thanks!
I have written such a package in Java.
https://github.com/ctongfei/progressbar
I don't think there's a built-in capability to do what you're looking for.
There is a library that will do it (JLine).
See this tutorial