Few fixes to work with Centos 7

I have struggled with errors cause by those lines so I tought I would share as a pull request.
First one is about java when java executable is not in the path.
Second one is return code 4 when deleting non existing file with rm -Rf
This makes sense to me