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