• 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
NSJavaVirtualMachine: Controlling the version of Java which is loaded
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSJavaVirtualMachine: Controlling the version of Java which is loaded


  • Subject: NSJavaVirtualMachine: Controlling the version of Java which is loaded
  • From: Evan Schoenberg <email@hidden>
  • Date: Wed, 20 Oct 2004 12:26:33 -0500

I've argued with this one for about 6 hours so far, to no avail.

Does anyone know how to control the version of Java loaded by NSJavaVirtualMachine?

Apple discusses that Java 1.3.1 is the default and describes how to specify the version of Java loaded by a double-clickable Java application here:
http://developer.apple.com/documentation/Java/Reference/Java14JavaDict/KeysValues/chapter_3_section_1.html

However, this only applies to Java apps; the JVMVersion key seems to have no effect on NSJavaVirtualMachine loaded via either the bundle setting
</key>
</string>

or via [NSJavaVirtualMachine defaultVirtualMachine] or [[NSJavaVirtualMachine alloc] initWithClassPath:...]

In both cases, Java 1.3.1 is loaded, as can be seen in the Java debug output:
[Opened /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Classes/classes.jar]
[Opened /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Classes/ui.jar]
[Opened /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Classes/i18n.jar]
[Opened /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Classes/sunrsasign.jar]

I need Java 1.4 because the classes I want to use from within my Objective-C program require 1.4 or better; trying to load them at present results in the following output:


com.apple.misc.BundleClassLoader@5fc547: while trying to define archiveresource:file:/Users/evands/adium-joscar/build/Adium.app/Contents/PlugIns/joscar.AdiumPlugin/Contents/Resources/Java/joscar-0.9.3-patched.jar/+/net/kano/joscar/snaccmd/icbm/SendImIcbm.class, (null), got throwable: java.lang.UnsupportedClassVersionError: Unsupported major.minor version 48.0
java.lang.UnsupportedClassVersionError: Unsupported major.minor version 48.0
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
at java.lang.ClassLoader.defineClass(ClassLoader.java:423)
at com.apple.misc.BundleClassLoader.getClassesFromLocations(BundleClassLoader.java:158)
at com.apple.misc.BundleClassLoader.getClassesFromResourceLocator(BundleClassLoader.java:115)

I do have both the Java 1.4.2 update and the Java 1.4.2 Developer Update 1 installed.

Thanks very much in advance for any help,
Evan Schoenberg
www.adiumx.com
_______________________________________________
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
  • Prev by Date: Re: [newbie] Create app as a startup item
  • Next by Date: A question I'm ashamed to ask
  • Previous by thread: Scrolling an NSImageView
  • Next by thread: A question I'm ashamed to ask
  • Index(es):
    • Date
    • Thread