• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

JNI_CreateJavaVM

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic