fixing the signal handling issues with Java
Merge pull request #1 from pshomov/master

fixing the signal handling issues with Java