Added workaround for not finding JAVA_HOME as per travis-ci/travis-ci#2616.