application C++/Java dependency -
application C++/Java dependency -
i have builder c++ application create vm process metadata file. application comunicate extractmetadata.jar jni.
when test ide, works fine(the process metadata works fine). when create setup application , run process metadata not run fine.
i logged , seems class not found.
jclass cls; jmethodid midallfield, midconstructor, mid1; jobject newobj; jboolean iscopy; file *filemeta; string strfields, strvaluefields, strfld; javavm* jvm; jnienv* env; // attach thread jvm jint succgetjvm = gl_env->getjavavm(&jvm); int succ1 = succgetjvm; if(succgetjvm!=0) logging(sextractmetalogfile, "\n getjavavm(&jvm) : failure "); else { logging(sextractmetalogfile, "\n getjavavm(&jvm) : success :"); logging(sextractmetalogfile, inttostr(succ1)); } jint succattchd = jvm->attachcurrentthread((void**)&env, null); int succ2 = succattchd; if(succattchd!=0) logging(sextractmetalogfile, "\n attachcurrentthread : failure "); else{ logging(sextractmetalogfile, "\n attachcurrentthread : success : "); logging(sextractmetalogfile, inttostr(succ2)); } cls = (*env).findclass("extractmetadata"); jthrowable exc = env->exceptionoccurred(); if (exc) { jclass newexccls; seek { env->exceptiondescribe(); } grab (...) { showmessage("env->exceptiondescribe()"); return; } logging(sextractmetalogfile, "\n exceptiondescribe : "); env->exceptionclear(); } if(cls !=0) { //.... } else { logging(sextractmetalogfile, "\n tika thread not found class : extractmetadata "); }
and log result
getjavavm(&jvm) : success :0 attachcurrentthread : success : exceptiondescribe : tika thread not found class : extractmetadata
why works fine when start application ide , not work when run installed application?!!
so answer:
open properties of shortcut , set field "start in" "c:\program files (x86)\xxx\bin\"
java c++ jvm jni dependencies
Comments
Post a Comment