Native library dll loading issue in java 11, properly working in java 8

I have two libraries: test1.dll and test2.dll. I have dynamically loaded these two libraries into my java application using System.loadLibrary() function in the given order, fist load test1.dll and second load the test2.dll.I have written a function called testFunction() in c++, ant these function implementation available in both test1.dll and test2.dll by a.cpp and b.cpp files with different argument. i.e, testFunction(JNV *env,JNv object, int arg), testFunction(JNV *env,JNv object).i have a header file called testing.h which contains the declaration of the testFunction both both a.cpp and b.cpp files. declaration is different because of function argument but header file name is same which is included in both cpp files.

now my problem is, i have upgraded my java application JRE version from 8 to 11. After upgrading 11 i have faced invalid argument exception with JVM crash due to wrong testFuntion is called during runtime even though i have called correct one. note – both dll are loaded in memory but runtime at java 11,and the dll is created using java 8.

My query is i already have same method name, different method signature, same header file name with different method declaration in java 8. there native call working fine. why in java 11 not working?

  • Don’t just describe the code. Post it.

    – 

Leave a Comment