Java – How to clear console in Java – Eclipse SDK

java

I've searched far and wide, but haven't found something that works…
There HAS to be a way!!! So, what I need is a code that clears the console in Eclipse (makes it blank). And NO, not printing 50 blank lines, CLEARING IT!

I found this:

Import import java.io.Console;

public void ClearConsole() {
            Console console = System.console();        
            if (console == null)
                    System.out.println("Couldn't get Console object !");
            console.clear();
    }

But it gives me an error: "The method clear() is undefined for the type Console"

Best Solution

In Eclipse tool you can clear the console panel by right clicking + clear but not in Java.

Console is a log tool, it cannot be cleared for administration security.