From c20622ade474a1c34a26872e6cc25dd592bc75a8 Mon Sep 17 00:00:00 2001
From: Misty De Meo <mistydemeo@github.com>
Date: Tue, 19 Apr 2016 23:35:32 -0700
Subject: [PATCH] JavaRequirement: return false if no java_home

Closes #118.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
---
 Library/Homebrew/requirements/java_requirement.rb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Library/Homebrew/requirements/java_requirement.rb b/Library/Homebrew/requirements/java_requirement.rb
index 93650d4136..86b5d2b5a5 100644
--- a/Library/Homebrew/requirements/java_requirement.rb
+++ b/Library/Homebrew/requirements/java_requirement.rb
@@ -6,6 +6,8 @@ class JavaRequirement < Requirement
   download "http://www.oracle.com/technetwork/java/javase/downloads/index.html"
 
   satisfy :build_env => false do
+    return false unless File.executable? "/usr/libexec/java_home"
+
     args = %w[--failfast]
     args << "--version" << "#{@version}" if @version
     @java_home = Utils.popen_read("/usr/libexec/java_home", *args).chomp
-- 
GitLab