File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -222,20 +222,23 @@ if test "${JAVA_LIBS}" = '~autodetect~'; then
222222 break
223223 fi
224224 done
225+ IFS=${save_IFS}
225226 # Then try some heuristics using sun.boot.library.path
226227 if test ${has_libjvm} = no; then
227228 boot_path=`"$JAVA" -classpath "${tools_classpath}" getsp sun.boot.library.path| ${SED-sed} -e 's/:$//' -e 's/^://'`
228229 if test -n "${boot_path}"; then
229- for dir in "${boot_path}" "${boot_path}/client" "${boot_path}/server"; do
230- if test -f "$dir/libjvm${DYLIB_EXT}"; then
230+ # libjvm is typically in the variant subdirectory. For variants
231+ # see make/autoconf/hotspot.m4 in JDK sources:
232+ VALID_JVM_VARIANTS="server client minimal core zero custom"
233+ for dir in '' ${VALID_JVM_VARIANTS}; do
234+ if test -f "${boot_path}/$dir/libjvm${DYLIB_EXT}"; then
231235 has_libjvm=yes
232- java_library_path="${dir} "
236+ java_library_path="${boot_path}/$dir "
233237 break
234238 fi
235239 done
236240 fi
237241 fi
238- IFS=${save_IFS}
239242 # replace occurrences of JAVA_HOME with $(JAVA_HOME)
240243 # If JAVA_HOME was a link, it will be the canonical path we
241244 # want to replace. We need working realpath to determine what that is.
You can’t perform that action at this time.
0 commit comments