The issue can be solved by using the solution as proposed in the following link:
Just googled it a bit and it might be an openJDK bug: https://bugs.openjdk.java.net/browse/JDK-8149417
There is a threat about it on github: https://github.com/jruby/jruby/issues/4101
You might want to check which version you are using because the status of the bug seems to be fixed in later versions.
Regards,
Ronald