Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JNI Calling Java code when attaching to existing JVM

843829May 17 2002 — edited Jan 9 2003
I've got an Active/X that runs within IE, and also makes JNI calls (via the Invocation API) to Java code. Running within IE means there's already a JVM around, so I attach to it using JNI_GetCreatedJavaVMs

This is fine. The problem is that I can't use the JNI findClass() to locate my Java classes, because I have no control over the classpath that the JVM is using to locate classes. The only solution I can think of so far is to either add my classes as part of the JVM, OR find out the classpath of the existing JVM (using System.getProperty("java.class.path") and copy my classes into that directory.

Both solutions look ugly - anyone know of a cleaner way ?

Mark.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 6 2003
Added on May 17 2002
13 comments
597 views