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

Support for JNI 1.8 #7

Closed
FransM22 opened this issue Nov 4, 2014 · 3 comments
Closed

Support for JNI 1.8 #7

FransM22 opened this issue Nov 4, 2014 · 3 comments

Comments

@FransM22
Copy link

FransM22 commented Nov 4, 2014

JavaCall causes an error when using it with JNI versions later than 1.6. The error displayed is ERROR: assertion failed: jni_version == JNI_VERSION_1_6. Since JDK 1.8, JNI version 1.8 is included, making this assertion always fail when using JavaCall on *.jar files created with this version of Java.

Line 457 In src/JavaCall.jl (@assert ccall(jnifunc.GetVersion, Cint, (Ptr{JNIEnv},), penv) == JNI_VERSION_1_6) causes the error.

Changing the line to @assert jni_version >= JNI_VERSION_1_6 #Also allowing jni 1.8 solves the issue. I can't find any changes since 1.6, and after a little testing, using JNI 1.8 seems to be working fine.

@aviks
Copy link
Collaborator

aviks commented Nov 5, 2014

Well, it looks like Oracle have changed the API version without documenting the change. The JDK8 docs still mention 1_6 as the latest available JNI version. http://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/functions.html#version_information

I am therefore hesitant to claim support in JavaCall for something that is so underspecified. There have been some reports of crashes with JDK8. eg #6. Can you try retrieving an exception in JDK8 (just throw an exception in any code that you call via JavaCall) and see what happens?

@aviks
Copy link
Collaborator

aviks commented Jun 21, 2015

JavaCall.jl now does work on 1.8. The assertion checking for 1.7 has been removed. In Linux, there are no reported issues due to 1.8. In OSX however, there are some spurious segfaults when moving from 1.7 to 1.8

@aviks
Copy link
Collaborator

aviks commented Jul 6, 2015

Everything should be fixed in JavaCall 0.2.3 onwards. Note that on OSX, there are messages printed to console about segfaults, but they are harmless, and are due to the interaction of Java and Julia's signal handlers. In julia 0.4 run with --handle-signals=no (but that might disable ctrl-C)

Please let me know if there are any further issues.

@aviks aviks closed this as completed Jul 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants