added code to detect java_home env variable