This is an automated email from the ASF dual-hosted git repository. karthikz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-heron.git
The following commit(s) were added to refs/heads/master by this push: new b3522d2 Add JDK/JAVA_HOME to bazel_configure.py (#2921) b3522d2 is described below commit b3522d2c319965630b64d0c9a45a3a5b56d6fca6 Author: Oliver Bristow <evilumbrella+git...@gmail.com> AuthorDate: Mon Jun 18 14:10:01 2018 +0100 Add JDK/JAVA_HOME to bazel_configure.py (#2921) --- bazel_configure.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bazel_configure.py b/bazel_configure.py index b91efe2..ed8b439 100755 --- a/bazel_configure.py +++ b/bazel_configure.py @@ -263,6 +263,19 @@ variable to specify the full path to yours.'""" % (program, program, program, en print('Using %s:\t%s' % (msg.ljust(20), print_value)) return VALUE +def discover_jdk(): + try: + jdk_path = os.environ['JAVA_HOME'] + except KeyError: + javac_path = real_program_path('javac') + if javac_path is None: + fail("You need to have JDK installed to build Heron.\n" + "You can set the JAVA_HOME environment variavle to specify the full path to yours.") + jdk_bin_path = os.path.dirname(javac_path) + jdk_path = os.path.dirname(jdk_bin_path) + print('Using %s:\t%s' % ('JDK'.ljust(20), jdk_path)) + return jdk_path + ###################################################################### # Discover the linker directory ###################################################################### @@ -377,6 +390,7 @@ def main(): env_map['CXXCPP'] = discover_tool('cpp','C++ preprocessor', 'CXXCPP', cpp_min) env_map['LD'] = discover_tool('ld','linker', 'LD') env_map['BLDFLAG'] = discover_linker(env_map) + env_map['JAVA_HOME'] = discover_jdk() # Discover the utilities env_map['AUTOMAKE'] = discover_tool('automake', 'Automake', 'AUTOMAKE', '1.9.6') -- To stop receiving notification emails like this one, please contact karth...@apache.org.