NoClassDefFoundError exception
Hi,
I want to write a native method that returns an array of String. I wrote the following code just for test since I've never worked before with JNI.
JNIEXPORT jobjectArray JNICALL Java_main_RegQuery_getValues (JNIEnv *env, jobject obj){
jclass stringArrCls = env->FindClass("Ljava/lang/String");
if (stringArrCls == NULL){
return NULL;/* exception thrown */
}
jobjectArray result = env->NewObjectArray(10, stringArrCls, NULL);
return result;
}
The code compiles and builds just fine, but when I call the method from java i get the exception:
Exception in thread "main" java.lang.NoClassDefFoundError: Ljava/lang/String
at main.RegQuery.getValues(Native Method)
at main.RegQuery.main(RegQuery.java:6)
I want to add that the C++ code is part of a VC6.0 project and i've set "C:\PROGRAM FILES\JAVA\JDK1.6.0\INCLUDE" and "C:\PROGRAM FILES\JAVA\JDK1.6.0\INCLUDE\WIN32" paths to it.
I suspect that the problem is somepath that is not included in my projects, but I don't know where. Maybe you could help me, please.
Thanks in advance

