The moose likes Java in General and the fly likes clering the console Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "clering the console" Watch "clering the console" New topic

clering the console

Dave Harpster

Joined: Apr 11, 2002
Posts: 7
Howdy folks,
Is there anyway to clear the console that will work on any platform?
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Well, you can println() about 30 time :roll: .
I know - lousy solution. - but it IS platform independant .

"JavaRanch, where the deer and the Certified play" - David O'Meara
expired user

Joined: Dec 13, 2001
Posts: 11
Why don't try JAVAW instead of println() 30 times?
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Because that would GET RID OF the console (well, sort of - the user could close the console) - not clear it so you get a clean display of the console.
Thomas Smets
Ranch Hand

Joined: Dec 11, 2001
Posts: 111
When even on MS-environment you can use the Unix commands with
cygwin. You will still have many little assless like some shells do keep listen to the console, hence you program would need to :
java Main > /dev/null </dev/null &
Another option is to start a little program that will do the Runtime.exec(MyCommandLine); !
The first program is started under javaw while the second receives the plateform specific options accordingly !
Have you given a look at ANT ?
(I personnaly like System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");)
[ April 15, 2002: Message edited by: Thomas SMETS ]

Thomas Smets
Just another developper
I agree. Here's the link:
subject: clering the console
It's not a secret anymore!