JNI and JVM Version
JNI and JVM Version
- Subject: JNI and JVM Version
- From: email@hidden
- Date: Wed, 22 Feb 2006 23:28:20 +0000
Hi all,
So I'm writing an application in Obj-C Cocoa, and would like to utilize a set of classes created using Java 1.5's generics and other assorted funities.
The default jre being used in Tiger is 1.4.2 and I don't want to change it at the system level.
Eventually I want to distribute my application to other folks, so I don't want to hack any symbolic links or anything in the system. Is there a way to declare the jvm version I want to use either through the initial setup of JVM or some other thing I can do programmatically or through configuration?
Here's a snippet from when I create the jvm...
JavaVMOption options[1];
JavaVMInitArgs vm_args;
long status;
options[0].optionString = "-Djava.class.path=/Users/Me/Jars/Employee.jar";
memset(&vm_args, 0, sizeof(vm_args));
vm_args.version = JNI_VERSION_1_2;
vm_args.nOptions = 1;
vm_args.options = options;
status = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
if (status != JNI_ERR) {
NSLog(@"JVM CREATED");
}
And here is when I attempt to retrieve a class reference from the jvm I get errors.
NSString *javaClassName = @"org/ph/TestClass";
const char *temp = [javaClassName cString];
jObjectClass = (*env)->FindClass(env, temp);
Thanks in advance for any assistance.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden