Added exception handling. Restart role if JAVA_HOME not set