Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I clear the screen in CMD

 
Jahed Hossain
Greenhorn
Posts: 11
Firefox Browser Linux Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using Windows 7 and I'm wondering how I can clear the command line screen,
using java code, like normally you would write CLS for Command & Prompt.
 
Paul Clapham
Sheriff
Pie
Posts: 20202
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The CLS command works for me in Windows 7. What happens when you type CLS at the command line?

(Also I will move this to the General Computing forum since it isn't about Java.)
 
Jahed Hossain
Greenhorn
Posts: 11
Firefox Browser Linux Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:The CLS command works for me in Windows 7. What happens when you type CLS at the command line?

(Also I will move this to the General Computing forum since it isn't about Java.)


I'm looking for a statement or something you can write in java to clear the screen.
 
Paul Clapham
Sheriff
Pie
Posts: 20202
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What screen?
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are going to have to invoke some Win32 API functions to do this for you. Which means you need to write a native library to access those functions. This might help:
http://support.microsoft.com/kb/99261?wa=wsignin1.0
 
Martin Vajsar
Sheriff
Pie
Posts: 3747
62
Chrome Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd say it should be also possible using either the Jansi, or perhaps JCurses library.

The Jansi library seems to provide platform independent way to do manipulate console output.

JCurses would allow you to create and manage your own console (that's way different from using stdout, but perhaps it might fit your needs too).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic