I copied your code for testing and I did get the message:
>> JVM started okay ...

I am using blackdown's JDK1.2.2.

I used the following commands to compile and run your program though:

$ gcc -c -o jvm.o -I/usr/local/jdk1.2.2/include
-I/usr/local/jdk1.2.2/include/linux jvm.c

$ gcc -o jvm jvm.o -L/usr/local/jdk1.2.2/jre/lib/s390/classic -ljvm
-L/usr/local/jdk1.2.2/jre/lib/s390/native_threads -lhpi

$ export
LD_LIBRARY_PATH=/usr/local/jdk1.2.2/jre/lib/s390/classic:/usr/local/jdk1.2.2
/jre/lib/s390/native_threads:/usr/local/jdk1.2.2/jre/lib/s390

$./jvm

Hope this gives you some info on what you are looking for.

Thanks,

Samy Rengasamy.


-----Original Message-----
From: Tom Butts [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 17, 2002 4:36 PM
To: [EMAIL PROTECTED]
Subject: Java problem


/*
We have been unable to instantiate a JVM via a "c" program running
on Suse Linux V7.0 with JDK1.3.0. Below is a sample "c" program to
instantiate the JVM. When the program runs, the following messages
are display:

>> Creating JVM
Cannot obtain system-specific information
>> JVM creation failed rc=-1

Has anyone seen the message "Cannot obtain system-specific information",
and knows what it means???

Below was how the program was compiled and linked and executed:

cc -c -o jvm.o -I/usr/lib/java/include jvm.c
cc -o jvm jvm.o -L/usr/lib/java/jre/bin/classic -ljvm
export LD_LIBRARY_PATH=/usr/lib/java/jre/bin/classic
./jvm

Thanks for any help!!!!

*/

#include <jni.h>

int main()
{
    JavaVM  *jvm;
    JNIEnv  *env;
    JavaVMInitArgs vm_args;
    JavaVMOption options[1];
    jint res;

    /* Create the JVM. */
    options[0].optionString = "-Djava.class.path=./classes";
    vm_args.nOptions = 1;
    vm_args.options = options;
    vm_args.version = JNI_VERSION_1_2;
    vm_args.ignoreUnrecognized = 1;
    printf(">> Creating JVM\n");
    res = JNI_CreateJavaVM(&jvm, (void **)&env, &vm_args);
    if (res < 0) {
        printf(">> JVM creation failed rc=%d\n", res);
        return res;
    }
    printf(">> JVM started okay...\n");

    return 0;
}

Reply via email to