config: return early if java_home is missing

Fixes mistydemeo/tigerbrew#365.
This commit is contained in:
Misty De Meo 2016-02-01 09:59:03 -08:00
parent 258a764f67
commit a662bd4470

View File

@ -148,6 +148,9 @@ module Homebrew
end
def describe_java
# java_home doesn't exist on all OS Xs; it might be missing on older versions.
return "N/A" unless File.executable? "/usr/libexec/java_home"
java_xml = Utils.popen_read("/usr/libexec/java_home", "--xml", "--failfast")
return "N/A" unless $?.success?
javas = []