• Post Reply Bookmark Topic Watch Topic
  • New Topic

JNI_CreateJavaVM

 
Chris Huisman
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having trouble starting a JVM via JNI. Does anybody know what the return value of JNI_CreatJavaVM indicates?
 
gat98
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chris Huisman:
I am having trouble starting a JVM via JNI. Does anybody know what the return value of JNI_CreatJavaVM indicates?

JNI_CreateJavaVM fills in two return values:
jvm refers to the created Java Virtual Machine. You can use this to destroy the Virtual Machine at a later time.
env is a JNI interface pointer that the current thread can use to access Java features, such as calling a Java method.
regds
gat
 
Corey Cole
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The return value of JNI_CreateJavaVM is 0 if there's
no problem, and a negative number if there was an error.
From jni.h:
#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 */
Granted, this topic is quite old, but hopefully if Google picks it up it'll help someone down the road
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!