简体   繁体   中英

Return code of JNI_CreateJavaVM

I found the http://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/invocation.html

was the documentation of JNI call funcitons.

But for example if I call:

JNI_CreateJavaVM

There is this technotes:

https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/invocation.html#JNI_CreateJavaVM

I know the return code is a jint telling me:

  • if the return of the function is 0 ok
  • if the return of the funciton is negative is not ok or some issue.

The above documentation of the method JNI_CreateJavaVM says:

RETURNS:
Returns JNI_OK on success; returns a suitable JNI error code (a negative number) on failure.

But I dont know exactly what is the the real result because it does not say the possible error codes.

So I can't create any JVM because it gives me a *jvm pointer null, and the ERROR CODE is -1.

Is there a "javadoc" of JNI?

jni.h defines the possible return values for JNI functions:

#define JNI_OK           0                 /* success */
#define JNI_ERR          (-1)              /* unknown error */
#define JNI_EDETACHED    (-2)              /* thread detached from the VM */
#define JNI_EVERSION     (-3)              /* JNI version error */
#define JNI_ENOMEM       (-4)              /* not enough memory */
#define JNI_EEXIST       (-5)              /* VM already created */
#define JNI_EINVAL       (-6)              /* invalid arguments */

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM