It's not possible in pure Java. You'll need to use some native code to accomplish this. For example, Here's a post I made on how to accomplish this on Windows.

Alternatively, you can use the Java...