21 lines
587 B
Bash
Executable File
21 lines
587 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Sets the LD_LIBRARY_PATH required for running ITs dependent on libjvm.
|
|
# See CONTRIBUTING.md for details.
|
|
|
|
JAVA_HOME="${JAVA_HOME:-$(java -XshowSettings:properties -version \
|
|
2>&1 > /dev/null |\
|
|
grep 'java.home' |\
|
|
awk '{print $3}')}"
|
|
|
|
if [[ "$(uname -s)" == "Darwin" ]]; then
|
|
LIB_NAME="libjli"
|
|
else
|
|
LIB_NAME="libjvm"
|
|
fi
|
|
|
|
# As JDK 8 and 9+ use different relative paths for libjvm, find the library:
|
|
LIBJVM_PATH="$(find "${JAVA_HOME}" -type f -name "${LIB_NAME}.*" -print0 -quit | xargs -0 -n1 dirname)"
|
|
|
|
export LD_LIBRARY_PATH="${LIBJVM_PATH}"
|