Java is not a low level language. Therefore, some interactions with the operating system are not supported.
The only solution is to create the code using a language that can actually work with the OS like C / C ++ and call it from java using JNI.
source
to share