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

Build failure with Java 10 due to the removal of javah #55

Closed
ebourg opened this issue May 9, 2018 · 7 comments · Fixed by #84
Closed

Build failure with Java 10 due to the removal of javah #55

ebourg opened this issue May 9, 2018 · 7 comments · Fixed by #84

Comments

@ebourg
Copy link

ebourg commented May 9, 2018

Hi, jffi fails to build with Java 10 or later due to the removal of the javah tool. We fixed this in Debian by:

  • removing the <javah> task in the Ant build
  • adding the nativeHeaderDir to the <javac> tasks
  • adding the @Native annotation (introduced in Java 8) to the fields in ObjectBuffer.java and Version.java used by the native code

Here is the patch we used: https://salsa.debian.org/java-team/jffi/blob/master/debian/patches/java10-compatibility.patch

@headius
Copy link
Member

headius commented May 16, 2018

@ebourg Thanks for the report and patch! I am a bit wary about using a Java 8-only annotation, though. We have at the very least JRuby 9.1.x which supports Java 7, and there are others out there using JNR-* on releases earlier than 8. Is there a way to do this so it works on both 7 and 8?

@ebourg
Copy link
Author

ebourg commented May 16, 2018

Maybe by copying the java.lang.annotation.Native class into the project? Adding a bogus native method in the Version class should also work.

@headius
Copy link
Member

headius commented May 23, 2018

Honestly moving to Java 8 sounds like less hassle, but I'm not sure how other users might feel about that. I will play with this patch tomorrow, but if you know: does the resulting library still work with Java 7?

cc @enebo

@headius
Copy link
Member

headius commented May 23, 2018

Ok, so I've created https://github.com/jnr/jnr-a64asm but not pushed anything. Feel free to send a pull request and we can get everything in the right places for release. Welcome to the project!

@ebourg
Copy link
Author

ebourg commented May 23, 2018

does the resulting library still work with Java 7

It may if you ensure no Java 8+ method is used, with animal-sniffer for example.

@re-thc
Copy link

re-thc commented Jun 7, 2018

Moving to Java 8 would be good for the next release. Java 7 usage can be kept with the current release.

@ikelos
Copy link

ikelos commented Oct 31, 2019

Any progress on this, or a 1.3 release? 1.2.22 still throws this error under Openjdk-11...

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

Successfully merging a pull request may close this issue.

4 participants