I have the native function declarations I want to access via JNI and I have the DLL holding all class declarations.
I do not have the complete header file and its dependencies, but I do have the DLL which holds all the information.
Is it possible to create a JNI interface using SWIG with only having the DLL and the function declaration?
see also: SWIG CYGWIN DLL linking which is a very similar problem.
You can't do this unless you can guess enough information from the DLL to be able to reconstruct a (possibly partial) header file.
It needs to contain information about the functions you care about (doesn't have to be all) and the types you care about (doesn't have to be all of them, but you need to know their names for every function).
With that you can construct a module file as normal. You can guess/infer some of that information depending on if it's C++ or C - if it's C++ the mangled name will tell you most of what you need to know for the inputs, but not the return types.
As an example I compiled:
as a DLL using:
From that I can see the symbols in the DLL by doing:
The interesting ones are:
So I can infer that a SWIG module to wrap these might look something like:
You'll still need to construct enough of a header to allow the generated wrapper to compile though.