HRCPP-147 Make the cmake configuration less brittle if Java is missing

https://issues.jboss.org/browse/HRCPP-147