Re: Java - Objective-C bridge and loading classes
Re: Java - Objective-C bridge and loading classes
- Subject: Re: Java - Objective-C bridge and loading classes
- From: Brent Gulanowski <email@hidden>
- Date: Fri, 17 Sep 2004 01:40:01 -0400
On Thu, 16 Sep 2004 21:58:27 -0400, Brent Gulanowski
<email@hidden> wrote:
> I am trying to use a Java library from Cocoa called JXTA (<http://ww.jxta.org>).
>
> I have successfully followed some instructions here:
> <http://www.cocoadev.com/index.pl?XcodeObjCJavaBridge>
> (which I have emended somewhat) and have successfully accessed Java
> classes as described. But when I try to load classes from jxta.jar,
> things go haywire:
>
> com.apple.misc.BundleClassLoader@40e45a: while trying to define
> archiveresource:file:/Volumes/Clarke/Users/brentgulanowski/Programming/PB
> builds/jxta.jar/+/net/jxta/access/AccessService$1.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)
>
> and the same thing for every class in the archive. I built the archive
> with Eclipse on the same machine that I'm building this test project
> in Xcode. OS X 10.3.5, Java 1.4.2.
>
> This is the result of calling NSJavaClassesFromPath() with the path to
> the jxta.jar archive.
It would seem that there must be a version mismatch between the JVM
and the compiled java classes. Eclipse picks up the JRE 1.4.2 just
fine. Could Cocoa be using an out-of-date JVM in the bridge? How do I
find out what selectors NSJavaVirtualMachine responds to (in case one
of them is "version") or otherwise inspect that class or find out
something about the version of the JVM it represents? Anyone? If it's
still using 1.3 can I do something ... other than re-compile the Java
classes in 1.3, which I don't think will work as they've updated the
source in ways that possibly aren't compatible.
--
Brent Gulanowski
http://www.boredastronaut.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