From 3a1544ab1a8094f5a8980ae0f98e2a021adf798e Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 24 Jul 2017 19:25:17 -0700 Subject: [PATCH] Make JAVA_HOME absolute inside build Export JAVA_HOME as an absolute path to commands running inside a build. Should fix errors invoking gradle from inside a build: ERROR: JAVA_HOME is set to an invalid directory: prebuilts/jdk/jdk8/linux-x86 Please set the JAVA_HOME variable in your environment to match the location of your Java installation. Test: treehugger Change-Id: I16e4482b2d74ede0843715be3b08c65ce33cf403 --- core/combo/javac.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/combo/javac.mk b/core/combo/javac.mk index 6d05e068da..36ac2aa75f 100644 --- a/core/combo/javac.mk +++ b/core/combo/javac.mk @@ -18,7 +18,7 @@ common_jdk_flags := -Xmaxerrs 9999999 ANDROID_JAVA_HOME := prebuilts/jdk/jdk8/$(HOST_PREBUILT_TAG) ANDROID_JAVA_TOOLCHAIN := $(ANDROID_JAVA_HOME)/bin -export JAVA_HOME := $(ANDROID_JAVA_HOME) +export JAVA_HOME := $(abspath $(ANDROID_JAVA_HOME)) # Use the indexer wrapper to index the codebase instead of the javac compiler ifeq ($(ALTERNATE_JAVAC),)