RR: test and fix issues with java install.
RR: tested  bash script line by line.