Closed marschall closed 10 months ago
FYI, jni-rs
uses such build script to find a libjvm: https://github.com/jni-rs/jni-rs/blob/master/build.rs#L80
There is a rough bash alternative too from exonum:
# Unfortunately, a simple `which java` will not work for some users (e.g., jenv),
# hence this a bit complex thing.
JAVA_HOME="$(java -XshowSettings:properties -version 2>&1 > /dev/null | grep 'java.home' | awk '{print $3}')"
echo "JAVA_HOME=${JAVA_HOME}"
# Find the directory containing libjvm (the relative path has changed in Java 9).
export JAVA_LIB_DIR="$(find ${JAVA_HOME} -type f -name libjvm.\* | xargs -n1 dirname)"
I'm going to close this just because it's such an old issue and I guess it's very likely no longer an issue.
Please reopen if there's still an issue with building on macOS.
I have trouble building the project on macOS on Java 9+.
The issue is that
libjvm.dylib
has been moved from${JAVA_HOME}/jre/lib/server
to${JAVA_HOME}/lib/server
On my system it looks like this: