-
Notifications
You must be signed in to change notification settings - Fork 7
Determining linkage to libjvm
is less than perfect, doesn't work on certain Linux distros
#23
Comments
Aaaand I'm just now realizing that I made an comment on an issue not unlike this a while back, except I was advocating for doing it dynamically at runtime using |
I remember, you've commented in #12. |
Well I would design some kind of |
Made some progress on this in #29. Still need to run export LD_PRELOAD=/usr/lib/jvm/default-java/jre/lib/amd64/server/libjvm.so which is a huge pain in the ass. There's a way to get around this by using the We could potentially use #[link_args = ...], but that's not recommended. Worst-case scenario, we use OpenJDK as a submodule and build a static library at build-time. |
This won't work properly my machine as I don't have
$JAVA_HOME
set and I'm not on macOS.On my system (Xubuntu 16.04),
libjvm.so
lives in/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
. But there's a symlink to thejava-8-openjdk-amd64
directory at/usr/lib/jvm/default-java/jre/lib/amd64/server
. Different Linux distributions do things different ways so this might not work 100% the same outside of Debian-land.My
/etc/os-release
is:The problem is that not all Linux distributions have an OS release file like this, so it's actually really hard to figure out where
libjvm.so
is supposed to live. But worse-case scenario we can just search through/usr/lib/jvm
until we find a directory withlibjvm.so
in it, as most people don't have enough JVMs installed to make that unreasonably slow.I might make a pull request soon with a fix in
build.rs
that'll probably work on Debians, but I don't really have anything to test it with beyondcargo test
.The text was updated successfully, but these errors were encountered: