ACCUMULO-3662 Ensure JAVA_HOME is for a JDK

Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/cd5f184b
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/cd5f184b
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/cd5f184b

Branch: refs/heads/master
Commit: cd5f184b0590aac404fe610d953bfac836b272f8
Parents: b7fcc2f
Author: Christopher Tubbs <ctubb...@apache.org>
Authored: Thu May 28 16:19:37 2015 -0400
Committer: Christopher Tubbs <ctubb...@apache.org>
Committed: Thu May 28 16:19:37 2015 -0400

----------------------------------------------------------------------
 server/native/src/main/resources/Makefile | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/cd5f184b/server/native/src/main/resources/Makefile
----------------------------------------------------------------------
diff --git a/server/native/src/main/resources/Makefile 
b/server/native/src/main/resources/Makefile
index b9211aa..9ffeefe 100644
--- a/server/native/src/main/resources/Makefile
+++ b/server/native/src/main/resources/Makefile
@@ -30,7 +30,10 @@ ifeq ($(shell uname),Linux)
 endif
 
 ifeq ($(shell uname),Darwin)
-       JAVA_HOME=$(shell /usr/libexec/java_home)
+       JAVA_HOME=$(shell env | grep "^JAVA_HOME=" | cut -d= -f2)
+       ifeq ($(strip $(JAVA_HOME)),)
+               JAVA_HOME=$(shell /usr/libexec/java_home)
+       endif
        NATIVE_LIB:= libaccumulo.dylib
 ifneq (,$(findstring 10.9,$(shell sw_vers -productVersion)))
        MAVERICKFLAGS=-stdlib=libstdc++
@@ -38,6 +41,10 @@ endif
        CXXFLAGS=-dynamiclib -undefined dynamic_lookup -O3 
-I/System/Library/Frameworks/JavaVM.framework/Headers -I$(JAVA_HOME)/include 
-I$(JAVA_HOME)/include/darwin -Ijavah $(USERFLAGS) $(MAVERICK_FLAGS)
 endif
 
+ifeq (,$(wildcard $(JAVA_HOME)/bin/javah))
+$(error "JAVA_HOME does not point to a JDK. Exiting...")
+endif
+
 all : $(NATIVE_LIB)
 
 $(NATIVE_LIB) : $(SRCS) $(HDRS)

Reply via email to