Thursday, September 6, 2012

clear screen in java

Clearing the screen with Java in platform independent way (on both Windows and Linux platform).
Here are the videos that show how to clear the console:

Part 1


Part 2


You can download JANSI from http://jansi.fusesource.org/
You can refer to the API docs from http://jansi.fusesource.org/documentation/api/index.html

2 comments:

  1. hey, I was searching everywhere for something that erased my screen. However, when I download the .jar file what do I do with it? My pc wont run it. Also, if it worked and I wanted it to run in other's computers do they have to download it too?

    ReplyDelete
  2. you do not need to run the jay file.
    you need to include that jar file in your program's class path.

    you can move the jar along with the the programs itself.

    you will be invoking some methods of some class that are in the jar file.
    and those methods will clear the screen.

    post another comment if its not working. we will figure it out.

    ReplyDelete