Fix setup_java so $JAVA_HOME can be used.

This resolves LOGSTASH-1984 (https://logstash.jira.com/browse/LOGSTASH-1984).