3
votes

I have a shared library dll alone which is not created by me. I only know which functions are inside that dll. So far, I have loaded that dll file using System.loadLibrary(). I wanted to know how to invoke the functions in spring mvc without JNI.

P.S:The reason I don't want to use JNI is because i only know the function names and I can't really see the function definitions since it is a binary file.

Thanks.

1

1 Answers

3
votes

You can use jna (java-native-access): https://github.com/java-native-access/jna#readme

However you will still need to know the function definitions (the number and types of parameters the functions expect and what they return). Otherwise you will just crash your JVM trying to call any function.