PyJnius looks for the path
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/jre/lib/server/libjvm.dylib
but the jre
folder doesn't exist in this hierarchy anymore and it should look for
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/lib/server/libjvm.dylib
Looks like this just needs a small change at https://github.com/kivy/pyjnius/blob/master/setup.py#L82 , but I'm not sure exactly what should be different (e.g. is this a new condition if framework
has a certain value?). Would you be able to post the output of /usr/libexec/java_home
?
I'm running Mac OS 10.13 with Java from the most recent brew cask install java
.
$ /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
As a side note, in the past, with the -v
option, you had to do /usr/libexec/java_home -v 1.8
but now you have to do /usr/libexec/java_home -v 9
. Looks like they've committed to a new versioning scheme.
Hi @inclement, I'm just coming back to this now. Was this feedback enough to make an update?
Guys, any update ?
It's not just an OSX issue if you're using open-jdk the jre folder no longer exists. Any open jdk version >= 9 no longer has the jre folder. See http://openjdk.java.net/jeps/220 since java 9 the folder hierarchy was restructured. The jre/lib/amd64/server/libjvm.so path is no longer valid ( https://github.com/kivy/pyjnius/blob/1cbfef23fb9fcb0f15dcbfd8f4cd1fc9a54986b6/setup.py#L163 ).
Just Ctrl
+F
for libjvm.so
, but yeah, it's since 9:
https://packages.ubuntu.com/bionic/amd64/openjdk-8-jre-headless/filelist
https://packages.ubuntu.com/cosmic/amd64/openjdk-11-jre-headless/filelist
That bug will also affect the usage of Java >= 9 using the soon-to-be-released conda-forge builds: https://github.com/conda-forge/openjdk-feedstock/pull/34, https://github.com/conda-forge/openjdk-feedstock/pull/35, https://github.com/conda-forge/openjdk-feedstock/pull/36
Pyjnius 1.1.4 requires to unset DYLD_LIBRARY_PATH with JRE 1.8 regardless if the value is correct or not. While not backwards compatible it is good not to have to care about it in the environment any more.
@rhoerbe Could you please link some official documentation/changelog why this change happened. I'm curious if it has other implications for the whole system and not Java only.
The issue occurred within the Pycharm IDE in a rather bulky project that is not suitable to isolate the issue. When creating a separate demo-repo I was unable to reproduce it.
Now I am a few commits ahead, and changed the Django-settings, and cannot reproduce the issue in my main project any more. There are a couple of combinations to test to reproduce - I gave up.
What I can describe is that downgrading pyjnius from 1.1.4 to 1.1.3 fixed the issue. However, to reproduce it there seem be other factors than JRE 1.8 and DYLD_LIBRARY_PATH.
Most helpful comment
It's not just an OSX issue if you're using open-jdk the jre folder no longer exists. Any open jdk version >= 9 no longer has the jre folder. See http://openjdk.java.net/jeps/220 since java 9 the folder hierarchy was restructured. The jre/lib/amd64/server/libjvm.so path is no longer valid ( https://github.com/kivy/pyjnius/blob/1cbfef23fb9fcb0f15dcbfd8f4cd1fc9a54986b6/setup.py#L163 ).