1

Is it possible to create custom jni method linker within java application? What exactly I'm trying to do, is to rename or make a links to java native methods under different class path. For example in shared library I have native method declared with class path: com.example.org.SomeClass.someMethod. I would like to invoke this method in a java app from same class, but declared under another package name i.e my.custom.package.name.SomeClass.someMethod

Why I'm trying to do is because I'm using 2 versions of same library in one project which both uses JNI, So I have repacked one version of library with maven shade plugin with a different package name, and I'm getting unsatisfiedlinkerror during invoking JNI method from repacked library

jamal
  • 11
  • 4
  • Does this QA help: https://stackoverflow.com/q/1010645 ? – Jorn Vernee Sep 06 '18 at 11:41
  • Not really, since it's requires to hack native code which is unavailable for me. I need to create some kind of wrapper for java JNI native method native code linker, which will be changing class paths between java code and java methods defined inside shared library. Not sure if is it possible under java. – jamal Sep 06 '18 at 12:06

0 Answers0