Hi Janet, is zclass a simple hello world type class that doesn't call anything else? Can you run it from the command line without JNI, e.g. "java com.mycomp.mysetset.enterprise.zclass"?
Cheers, Dave Griffiths IBM Operational Decision Manager z/OS Developer IBM United Kingdom Limited, Hursley Park, Winchester, SO21 2JN, UK Tel: +44 1962 816478 Mobile: 07590 195531 [email protected] From: Janet Graff <[email protected]> To: [email protected] Date: 04/04/2016 19:33 Subject: Re: JVM FindClass returning Null Sent by: IBM Mainframe Discussion List <[email protected]> Ray, Thank you! I also figured out I wasn't in the working directory I thought I was in. The code now looks like this: chdir("/u/vendor/jig/DOMYAPI3"); dirPtr = getcwd(mydir,sizeof(mydir)); printf("current working directory is %s'\n", mydir); printf("calling FindClass\n"); #pragma convert(819) zprotect_class = (*env)->FindClass(env, "com/mycomp/mysetset/enterprise/zclass"); #pragma convert(0) if (zprotect_class == NULL) { (*env)->ExceptionDescribe(env); printf("findClass returned NULL\n"); rc = ERR_NO_CLASS; } the output in SYSPRINT looks like this current working directory is /u/vendor/jig/DOMYAPI3' calling FindClass findClass returned NULL I'm not sure what I should be fiddling with at this point. Is this affected by the classpath? Is there a way to list all the available classes? Janet >The class name needs to be fully qualified (but *without* that leading /) >It might be easier to use #pragma convert(819) to get a UTF-8 string. >#pragma convert(819) >zclass_class = (*env)->FindClass(env, "com/mycomp/mysetset/enterprise/zclass"); >#pragma convert(0) ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
