0

I have an native C++ application that creates a JVM (JNI_CreateJavaVM()), which executes a method in a specified class. I now want to call C++ functions from java using JNI. Is it possible to avoid System.loadLibrary() or do I have to create an extra dll just for JNI calls?

CalibeR.50
  • 370
  • 2
  • 13
  • 1
    Should be possible with `RegisterNatives()`: http://stackoverflow.com/questions/1010645/what-does-the-registernatives-method-do – Samuel Audet Feb 27 '15 at 03:18

1 Answers1

0

Your native C++ application is PE executable without JNI symbols exported. That means you can't mix your JNI method in your native executable, in order to call C++ functions from Java, you have to create another dll and load it with System.loadLibrary.

alijandro
  • 11,627
  • 2
  • 58
  • 74