JNI_CreateJavaVM exit code -1?

Ho un problema durante la creazione di JVM nel metodo JNI_CreateJavaVM, l’applicazione solo “Il programma” [4616] VnptTokenCplusplus.exe: Nativo “è uscito con il codice 1 (0x1).”, Qualcuno può spiegarlo per me?

#include  #pragma comment(lib,"jvm"); JNIEnv* Vnpt_JavaCreateVM(); void Vnpt_JavaInvokeClass(JNIEnv* env); int main(){ JNIEnv* env = 0; env = Vnpt_JavaCreateVM(); Vnpt_JavaInvokeClass(env); getchar(); } JNIEnv* Vnpt_JavaCreateVM() { jint res; JavaVM* jvm; JNIEnv* env; JavaVMInitArgs args; JavaVMOption options[1]; args.version = JNI_VERSION_1_2; // JNI_VERSION_1_2 is interchangeable for this example args.nOptions = 1; options[0].optionString = "-Djava.class.path=."; args.options = options; args.ignoreUnrecognized = JNI_FALSE; res = JNI_CreateJavaVM(&jvm, (void **)&env, &args); if(res FindClass( "com/vnpt/TestJDialog"); mainMethod = env->GetMethodID(mainClass, "tokenNotify", "()V"); env->CallVoidMethod(mainClass, mainMethod); } 

E uscita:

 'VnptTokenCplusplus.exe': Loaded 'D:\Documents and Settings\tandaica0612\Desktop\VDC\BaoCao\Source\VnptToken\VnptTokenCplusplus\DebugX86\VnptTokenCplusplus.exe', Symbols loaded. 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\ntdll.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\kernel32.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\KernelBase.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\crypt32.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\msvcrt.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\msasn1.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\advapi32.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\sechost.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\rpcrt4.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\ole32.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\gdi32.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\user32.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\lpk.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\usp10.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\oleaut32.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'D:\Documents and Settings\tandaica0612\Desktop\VDC\BaoCao\Source\VnptToken\VnptTokenCplusplus\DebugX86\jvm.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\winmm.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\msvcr71.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\imm32.dll', Cannot find or open the PDB file 'VnptTokenCplusplus.exe': Loaded 'C:\Windows\System32\msctf.dll', Cannot find or open the PDB file The program '[4616] VnptTokenCplusplus.exe: Native' has exited with code 1 (0x1). 

Stavo avendo lo stesso problema e ho fatto due cose per risolverlo:

1- Aggiungi il posto dove giace jvm.dll (dovrebbe essere nei file di programma \ java \ jsdk_ * \ bin \ server) alla variabile d’ambiente PATH sulla tua macchina Windows

2- Prova a cambiare “-Djava.class.path =.” puntare a una directory effettiva oa un file .jar (ha funzionato per me)