Forums Register Login

JNI problem

+Pie Number of slices to send: Send
I have a scientific application written in Ada. Our company has other
applications written in Java. I wanted to call, from the ada application,
some of the java methods. I created a C library that the Ada could
call, that would use the JNI to create a java VM. Well this worked
fine on the system that I was developing on. I developed on an
SUN system under java1.4. I took my application into a classified
network and it was unable to create the Java VM. I am having the same
problem creatintgthe VM on an unclassified SGI.
Here is the straitforward code :

strcpy(options[1].optionString, JAVA_VM_MEMORY_INIT_STR);
vm_args.version = JNI_VERSION_1_4;
vm_args.options = options;
vm_args.nOptions = NUM_JAVA_VM_COMMAND_LINE_OPTIONS;
vm_args.ignoreUnrecognized = JNI_TRUE;

res = JNI_CreateJavaVM(&jvm[*data_type], (void**)&env[*data_type], &vm_args);
if (res < 0)
{
fprintf(stderr, "Can't create Java VM\n");
return(res);
}

When I have version set to 1.4, the error code is -3 (JNI_EVERSION) and
when I set the version to 1.2, the error code is -1(JNI_ERR) and get a
message indicating hotspot cannot run with jdk 1.2 or something like that.
I am not aware that the CLASSPATH will have anything
to do with this. Does anyone have any ideas?
my LD_LIBARARY_PATH includes /ensco/apps/java1.4/jre/lib/sparc
The installation on the unclassified and classified SUNs seem to be the
same.
I really appreciate any help.
Rob Rassler
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 626 times.
Similar Threads
JNI Invocation Debugging
JNDI problem
JNI_CreateJavaVM returns with -1
Invoking JVM through C++ code
Calling java from Visual C
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:22:46.