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

Function get_potential_libjvm_paths

cpp/src/arrow/filesystem/hdfs_internal.cc:152–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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