• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
JNI and JVM Version
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: JNI and JVM Version
      • From: Greg Herlihy <email@hidden>
  • Prev by Date: Re: Behaving "nice"(1) in the background
  • Next by Date: Re: Behaving "nice"(1) in the background
  • Previous by thread: Re: Behaving "nice"(1) in the background
  • Next by thread: Re: JNI and JVM Version
  • Index(es):
    • Date
    • Thread