Bernd Kreimeier <[EMAIL PROTECTED]> writes:

> Juergen Kreileder writes:
>  > > Classpath default:
>  > >/../../../classes:/../../classes.zip:/../../classes.jar:
>  > Yes, you have to tell the VM where it can find classes.zip.
>  
> Could this please be clarified?
> 
> a) the classpath generated by the JVM is bogus, right?
>    If anything, it should be relative to it's location,
>     e.g. /usr/local/java/lib?
/../../../classes:/../../classes.zip:/../../classes.jar: is not a 
very useful classpath ;-) 
With that classpath the vm cannot find classes.zip and will fail
with: Unable to initialize threads: cannot find class java/lang/Thread

> 
> b) from the jdk1.1.6/README.linux:
>      No CLASSPATH, no JAVA_HOME, or other environment
>      variables to set to get the basic system running.
>    Now, I am not using the bin/ scripts when I do JNI.
>    Is my CLASSPATH environment variable totally ignored
>    here?
Afaik the enviroment CLASSPATH is ignored when you use the
JNI Invocation API (CLASSPATH isn't important for ordinary JNI).
CLASSPATH usually doesn't contain the path to classes.zip,
that part of CLASSPATH is set by the .java_wrapper script.

When you use Invocation you should override the
classpath returned by JNI_GetDefaultJavaVMInitArgs.
The classpath must include the path to classes.zip and
the path to your own classes/zip-/jar-archives. 
If you want to use environment variables for setting
the classpath you can use char* getenv(const char* name).

        Jürgen

-- 
Juergen Kreileder, Universitaet Dortmund, Lehrstuhl Informatik V
Baroper Strasse 301, D-44221 Dortmund, Germany
Phone: ++49 231/755-5806, Fax: ++49 231/755-5802

Reply via email to