Using Java / JNI on Cygwin

前端 未结 3 946
灰色年华
灰色年华 2020-12-12 01:59

I am entering into Java world just now. I am facing problem when I try to compile sample program for Calling C from Java.

I wanted to try the sample code for JNI (W

3条回答
  •  不知归路
    2020-12-12 02:46

    Ensure that your native library is really loaded by adding a try/catch block around the System.loadLibrary() call to catch the UnsatifiedLinkError Exception if your library could not be found. If that doesn't work post your error, "it return aborted" isn't very helpful. Also, you defined the native print method with a void return type, yet you have a return statement. Either remove that or let the method actually return something.

提交回复
热议问题