shamama@magicsoftware.com wrote:
> [..] but my problem is that my classes is in a jar file
> and I don't have the location of the jar when I'm creating the JVM.
Then your problem is /exactly/ the same as it would be if you were working in
Java directly, nothing whatever to do with JNI. The solution is also exactly
the same: create your own classloader (probably a java.net.URLClassLoader) and
use that to load code from the jar file.
(Actually you do have another option using JNI -- you could extract the
classfiles from the JAR file and then inject the bytecode into the JVM directly
using the DefineClass() function in JNI. Offhand, I can't think of any good
reason for wanting to do it that way, though.)
-- chris