title: Setting JDK Path for make OS X
body: <p>I am trying to build Android AOSP on Mac OS X 10.13.6</p>
  
  <p>When running <code>make</code> it outputs</p>
  
  <pre><code>build/core/config.mk:601: *** Error: could not find jdk tools.jar at /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/../lib/tools.jar, please check if your JDK was installed correctly.  Stop.
  </code></pre>
  
  <p><code>JAVA_HOME</code> and <code>ANDROID_JAVA_HOME</code> are both set to the directory of my JDK installation: </p>
  
  <pre><code>/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home
  </code></pre>
  
  <p>I know that the files under <code>System/Library/.../Commands</code> are stubs pointing to the correct JDK installation but <code>make</code> tries to find the <code>tools.jar</code> in this directory, too.</p>
  
  <p>Is there a way to tell <code>make</code> to search in the right directory?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Error appears in config.mk:601</p>
  
  <pre><code># We may not have the right JAVA_HOME/PATH set up yet when this is run from envsetup.sh.
  ifneq ($(CALLED_FROM_SETUP),true)
  HOST_JDK_TOOLS_JAR:= $(shell $(BUILD_SYSTEM)/find-jdk-tools-jar.sh)
  
  ifneq ($(HOST_JDK_TOOLS_JAR),)
  ifeq ($(wildcard $(HOST_JDK_TOOLS_JAR)),)
  $(error Error: could not find jdk tools.jar at $(HOST_JDK_TOOLS_JAR), 
  please check if your JDK was installed correctly)
  endif
  endif
  </code></pre>
  
  <p>But when running <code>find-jdk-tools-jar.sh</code> it outputs the correct path, where the tools.jar is indeed located. So make uses some other fallback?</p>