Hmm...ok, well that's good to hear. I must be doing something wrong then...I'm essentially doing everything I was doing when I was working with Java 1.4.x to start the JVM from cpp:
JavaVMInitArgs vm_args;
JavaVMOption * options = new JavaVMOption[1];
options[0].optionString = "-Djava.class.path=.";
vm_args.version = JNI_VERSION_1_6;
vm_args.options = options;
vm_args.nOptions = 1;
vm_args.ignoreUnrecognized = false;
res = JNI_CreateJavaVM(&m_jvm, (void**)&m_env,&vm_args);
Yet now I'm getting this -3 returned. I am linking with jvm.lib in the jdk 6 directory, and I am using the includes from the jdk 6 directory. Any idea what I'm doing wrong?
I should probably clarify that the "real" problem I am having is that when I compiled a class with javac version 1.6.0, FindClass("MyClass") failed.
Simply compiling the class with javac version 1.4.x or 1.5.x would fix this problem. I thought the problem had to do with the fact that I was specifying JNI_VERSION_1_4 for my JVM instead of JNI_VERSION_1_6, so then I went this route...and can't even create a JVM.
Any help is appreciated, thanks!
Maybe at runtime it tries to load the 1.4 jvm.dll?
Make sure that your Path environment variable has the appropriate jdk 6.0 folder set for jvm.dll (JDK6_HOME\jre\bin\client).
For instance on the command line:
> set Path=c:\jdk1.6\jre\bin\client;%Path%
> your_executable.exe
Regards