Hello,
I am getting the following error message when attempting to execute a JNI program on z/OS 2.3 with java 8:
Exception in thread "main" java.lang.UnsatisfiedLinkError: MyJniService.jniReq01()V
TestDriver:
public static void main(String[] args)
MyJniService jniService = new MyJniService();
jniService.jniReq01();
class MyJniService
{
public native void jniReq01();
static
{
System.out.println("MyJniService: Yes guys, i got here");
try
{
System.loadLibrary("FirstJni01");
}
catch(Exception e)
{
System.out.println( "MyJniService: ERROR: Unable to load Sample.so");
e.printStackTrace( );
}
System.out.println("MyJniService: Yes guys, i got here too");
}
Native C code:
#include <jni.h>
#include <stdlib.h>
#include "MyJniService.h"
JNIEXPORT void JNICALL Java_MyJniService_jniReq01
(JNIEnv *, jobject);
JNIEXPORT void JNICALL Java_MyJniService_jniReq01
(JNIEnv *env, jobject obj)
{
printf("Here in native code");
}
The link options used are:
-W "l,lp64,xplink,dll" -W "c,lp64,langlvl(extended),xplink,dll,exportall"
The libFirstJni01.so file was created successfully. Issuing nm on the .so file shows the correct external name.
Any ideas?
Thanks in advance.