Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JNI and JARs



Nathan Florea wrote:

>Also, if anyone else can recommend some good resources on accessing Java
>classes from native programs, I would really appreciate it. I have had a
>real hard time tracking anything down.

The JNI Specification and Programmer's Guide is indispensible.  The
description for the FindClass JNI function mentions J2SE's class-loaders,
so maybe the problem in your native code is that the right class-loader
isn't being used.

You may want to investigate what's going on by writing a plain JNI-free
Java program that asks specific Classes what their ClassLoader is, to get a
better sense of those relationships.

Regarding Java's extensions-dirs, which use class-loaders that are not the
bootstrap-classloader...

JDK 1.4's Endorsed Override dirs:
  <http://java.sun.com/j2se/1.4/docs/guide/standards/>

The Java Extensions mechanism described:
  <http://java.sun.com/j2se/1.4/docs/guide/extensions/index.html>

Mac OS X Java extensions dirs:
  <http://developer.apple.com/qa/qa2001/qa1170.html>


And see Apple's Java examples:
  <http://developer.apple.com/samplecode/Java/index-date.html>
  (e.g. simpleJavaLauncher)

  -- GG


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.