Advertisement

01.25.2008 at 10:27AM PST, ID: 23111889
[x]
Attachment Details

JNI_createJavaVM always return JNI_ERR

Asked by ramalaks in Java Native Interface (JNI), Java Programming Language, Java Standard Edition

Tags: JNI

I am using jdk1.5 and JNI_VERSION_1.4.
i am trying to create JVM as shown below
jint ret;
    char classpath[1024];
    JavaVMInitArgs  vm_args; /* VM initialization arguments */
    JavaVMOption options[1];
    sprintf(classpath, "-Djava.class.path=%s",USER_CLASSPATH);
    options[0].optionString = classpath;
    memset(&vm_args, 0, sizeof(vm_args));
    vm_args.version = JNI_VERSION_1_4; /* New in 1.1.2: VM version */
    vm_args.options = options;
    vm_args.nOptions = 1;
    vm_args.ignoreUnrecognized = JNI_TRUE;
    /* load and initialize a Java VM, return a JNI interface
     * pointer in env */
    ret = JNI_CreateJavaVM(&gJVM, (void**)&gJavaEnv, &vm_args);
    if (ret < 0)
    {
       dlogError("Can't create JVM. Error: %ld\n", ret);
       return;
    }

it always returns -1.  I have made my path to point to jvm.dll which in in jre/bin/client.  
what could be wrong?Start Free Trial
[+][-]01.26.2008 at 12:21PM PST, ID: 20751124

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]02.01.2008 at 08:33PM PST, ID: 20803111

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]02.03.2008 at 06:35AM PST, ID: 20808758

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Native Interface (JNI), Java Programming Language, Java Standard Edition
Tags: JNI
Sign Up Now!
Solution Provided By: Ajay-Singh
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.21.2008 at 10:32AM PDT, ID: 22282052

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]08.27.2008 at 09:22PM PDT, ID: 22331557

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628