• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

JNI problem

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
I think he's gonna try to grab my monkey. Do we have a monkey outfit for this tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic