Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatibility with Java 9 - JRE Path changed #304

Closed
cthoyt opened this issue Oct 19, 2017 · 11 comments · Fixed by #363
Closed

Incompatibility with Java 9 - JRE Path changed #304

cthoyt opened this issue Oct 19, 2017 · 11 comments · Fixed by #363
Labels

Comments

@cthoyt
Copy link

cthoyt commented Oct 19, 2017

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

@inclement
Copy link
Member

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?

@cthoyt
Copy link
Author

cthoyt commented Oct 20, 2017

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.

@cthoyt
Copy link
Author

cthoyt commented Feb 5, 2018

Hi @inclement, I'm just coming back to this now. Was this feedback enough to make an update?

@akshaysharma096
Copy link

Guys, any update ?

@bwkchee
Copy link

bwkchee commented Sep 24, 2018

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 (

lib_location = 'jre/lib/{}/server/libjvm.so'.format(cpu)
).

@KeyWeeUsr
Copy link
Contributor

@hadim
Copy link
Contributor

hadim commented Nov 21, 2018

That bug will also affect the usage of Java >= 9 using the soon-to-be-released conda-forge builds: conda-forge/openjdk-feedstock#34, conda-forge/openjdk-feedstock#35, conda-forge/openjdk-feedstock#36

hadim added a commit to hadim/pyjnius-feedstock that referenced this issue Nov 22, 2018
kivy/pyjnius#304 needs to be fixed to use OpenJDK >8
hadim added a commit to hadim/pyjnius that referenced this issue Nov 22, 2018
hadim added a commit to hadim/pyjnius that referenced this issue Nov 22, 2018
hadim added a commit to hadim/pyjnius that referenced this issue Nov 22, 2018
This was referenced Nov 22, 2018
@hadim
Copy link
Contributor

hadim commented Nov 22, 2018

Fixed in #363

@rhoerbe
Copy link

rhoerbe commented Dec 28, 2018

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.

@KeyWeeUsr
Copy link
Contributor

@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.

@rhoerbe
Copy link

rhoerbe commented Dec 28, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants