The first thing to do is understanding JNI (Java Network Interface) which you use if you want to call java functions from C/C++ code or vice versa.
Saying this, that doesn't mean it is easy to use JNI inside ns-3. It seems the easiest and probably the best way to run application on ns-3 node is use DCE. These applications are C/C++ applications, that's why you need JNI if you want to run Java code.
I guess you have another option by using AgentJ on ns-2 .
Could you tell me what exactly you are trying to do with JNI? Maybe we can find a better way.
Thanks,
Murad