Suppress JInput Warnings

159 Views Asked by At

My JInput code works fine, it just prints these warnings to the console every time the program starts. I need to suppress them.

Nov 29, 2017 8:59:55 AM net.java.games.input.DefaultControllerEnvironment getControllers WARNING: Found unknown Windows version: Windows 10 Nov 29, 2017 8:59:55 AM net.java.games.input.DefaultControllerEnvironment getControllers WARNING: Attempting to use default windows plug-in.

EDIT: I found a way to do it, but it's a bit of a hack: System.err.close(); Is there a way for me to temporarily disable System.err ?

1

There are 1 best solutions below

0
On BEST ANSWER

The solution is to use System.setErr():

    PrintStream error=System.err;
    System.setErr(new PrintStream(new OutputStream(){
        public void write(int a){}
    }));
    controllers=ControllerEnvironment.getDefaultEnvironment().getControllers();
    System.setErr(error);