aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/config.rb
diff options
context:
space:
mode:
authorMisty De Meo2016-02-01 09:59:03 -0800
committerMisty De Meo2016-04-22 22:37:21 -0700
commita662bd4470ae27c9fde0b7ba471421c8ef2da017 (patch)
treeba10f5dcef22e8d7a1ba66825468480fe7163efd /Library/Homebrew/cmd/config.rb
parent258a764f678b0d0d1c5bc0dee4a31d6ad79a8471 (diff)
downloadbrew-a662bd4470ae27c9fde0b7ba471421c8ef2da017.tar.bz2
config: return early if java_home is missing
Fixes mistydemeo/tigerbrew#365.
Diffstat (limited to 'Library/Homebrew/cmd/config.rb')
-rw-r--r--Library/Homebrew/cmd/config.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/config.rb b/Library/Homebrew/cmd/config.rb
index 8d3c1e0f0..bf78abe38 100644
--- a/Library/Homebrew/cmd/config.rb
+++ b/Library/Homebrew/cmd/config.rb
@@ -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 = []