From f77b31e64eae2fff826556cebb6364938561e402 Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Wed, 17 Jan 2018 18:51:59 -0500 Subject: [PATCH 1/2] Accommodate a JAVA_HOME containing the jre/ directory, or an absolute path to directory containing libjvm Change-Id: I783d4d25d7133b85b86d2653bf13de7692d2ada4 --- cpp/src/arrow/io/hdfs-internal.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/src/arrow/io/hdfs-internal.cc b/cpp/src/arrow/io/hdfs-internal.cc index 9cd1c5052fe..545b2d17d2e 100644 --- a/cpp/src/arrow/io/hdfs-internal.cc +++ b/cpp/src/arrow/io/hdfs-internal.cc @@ -147,7 +147,7 @@ static std::vector get_potential_libjvm_paths() { file_name = "jvm.dll"; #elif __APPLE__ search_prefixes = {""}; - search_suffixes = {"", "/jre/lib/server"}; + search_suffixes = {"", "/jre/lib/server", "/lib/server"}; file_name = "libjvm.dylib"; // SFrame uses /usr/libexec/java_home to find JAVA_HOME; for now we are @@ -175,7 +175,7 @@ static std::vector get_potential_libjvm_paths() { "/usr/lib/jvm/default", // alt centos "/usr/java/latest", // alt centos }; - search_suffixes = {"/jre/lib/amd64/server"}; + search_suffixes = {"", "/jre/lib/amd64/server", "/lib/amd64/server"}; file_name = "libjvm.so"; #endif // From direct environment variable From 7e14923d59013c2ba29987073660c228d9ca83b0 Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Wed, 17 Jan 2018 18:53:43 -0500 Subject: [PATCH 2/2] Add note to API documentation about JAVA_HOME Change-Id: I5e124850f140581e11ced62dc772340b77a5f053 --- cpp/apidoc/HDFS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp/apidoc/HDFS.md b/cpp/apidoc/HDFS.md index d54ad270c05..d3671fb7691 100644 --- a/cpp/apidoc/HDFS.md +++ b/cpp/apidoc/HDFS.md @@ -50,6 +50,10 @@ export CLASSPATH=`$HADOOP_HOME/bin/hadoop classpath --glob` * `ARROW_LIBHDFS_DIR` (optional): explicit location of `libhdfs.so` if it is installed somewhere other than `$HADOOP_HOME/lib/native`. +To accommodate distribution-specific nuances, the `JAVA_HOME` variable may be +set to the root path for the Java SDK, the JRE path itself, or to the directory +containing the `libjvm` library. + ### Mac Specifics The installed location of Java on OS X can vary, however the following snippet