[Webinar] Streamline your web hosting managementRegister Today


JNI_createJavaVM always return JNI_ERR

Posted on 2008-01-25
Medium Priority
Last Modified: 2013-12-22
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);

it always returns -1.  I have made my path to point to jvm.dll which in in jre/bin/client.  
what could be wrong?
Question by:ramalaks
1 Comment
LVL 23

Accepted Solution

Ajay-Singh earned 200 total points
ID: 20808758
> I have made my path to point to jvm.dll which in in jre/bin/client.

How did you do that?

It appears to me that its issue with jvm.dll


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month10 days, 7 hours left to enroll

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question