MCPcopy Create free account
hub / github.com/apache/arrow / get_potential_libjvm_paths

Function get_potential_libjvm_paths

cpp/src/arrow/io/hdfs_internal.cc:143–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143Result<std::vector<PlatformFilename>> get_potential_libjvm_paths() {
144 std::vector<PlatformFilename> potential_paths;
145
146 std::vector<PlatformFilename> search_prefixes;
147 std::vector<PlatformFilename> search_suffixes;
148 std::string file_name;
149
150// From heuristics
151#ifdef _WIN32
152 ARROW_ASSIGN_OR_RAISE(search_prefixes, MakeFilenameVector({""}));
153 ARROW_ASSIGN_OR_RAISE(search_suffixes,
154 MakeFilenameVector({"/jre/bin/server", "/bin/server"}));
155 file_name = "jvm.dll";
156#elif __APPLE__
157 ARROW_ASSIGN_OR_RAISE(search_prefixes, MakeFilenameVector({""}));
158 ARROW_ASSIGN_OR_RAISE(search_suffixes,
159 MakeFilenameVector({"/jre/lib/server", "/lib/server"}));
160 file_name = "libjvm.dylib";
161
162// SFrame uses /usr/libexec/java_home to find JAVA_HOME; for now we are
163// expecting users to set an environment variable
164#else
165# if defined(__aarch64__)
166 const std::string prefix_arch{"arm64"};
167 const std::string suffix_arch{"aarch64"};
168# else
169 const std::string prefix_arch{"amd64"};
170 const std::string suffix_arch{"amd64"};
171# endif
172 ARROW_ASSIGN_OR_RAISE(
173 search_prefixes,
174 MakeFilenameVector({
175 "/usr/lib/jvm/default-java", // ubuntu / debian distros
176 "/usr/lib/jvm/java", // rhel6
177 "/usr/lib/jvm", // centos6
178 "/usr/lib64/jvm", // opensuse 13
179 "/usr/local/lib/jvm/default-java", // alt ubuntu / debian distros
180 "/usr/local/lib/jvm/java", // alt rhel6
181 "/usr/local/lib/jvm", // alt centos6
182 "/usr/local/lib64/jvm", // alt opensuse 13
183 "/usr/local/lib/jvm/java-8-openjdk-" +
184 prefix_arch, // alt ubuntu / debian distros
185 "/usr/lib/jvm/java-8-openjdk-" + prefix_arch, // alt ubuntu / debian distros
186 "/usr/local/lib/jvm/java-7-openjdk-" +
187 prefix_arch, // alt ubuntu / debian distros
188 "/usr/lib/jvm/java-7-openjdk-" + prefix_arch, // alt ubuntu / debian distros
189 "/usr/local/lib/jvm/java-6-openjdk-" +
190 prefix_arch, // alt ubuntu / debian distros
191 "/usr/lib/jvm/java-6-openjdk-" + prefix_arch, // alt ubuntu / debian distros
192 "/usr/lib/jvm/java-7-oracle", // alt ubuntu
193 "/usr/lib/jvm/java-8-oracle", // alt ubuntu
194 "/usr/lib/jvm/java-6-oracle", // alt ubuntu
195 "/usr/local/lib/jvm/java-7-oracle", // alt ubuntu
196 "/usr/local/lib/jvm/java-8-oracle", // alt ubuntu
197 "/usr/local/lib/jvm/java-6-oracle", // alt ubuntu
198 "/usr/lib/jvm/default", // alt centos
199 "/usr/java/latest" // alt centos
200 }));

Callers

nothing calls this directly

Calls 4

MakeFilenameVectorFunction · 0.85
InsertEnvVarFilenameFunction · 0.85
push_backMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.50

Tested by

no test coverage detected