On Sun, 27 Sep 1998 16:24:46 +0200, Stefan Huebner wrote:

>Hello !
>
>I was just trying to install Java for the first time on my Linux Box,
>but I m not able to use appletviewer, or to view my class-files from
>the command-prompt:
>
>Linux 2.0.35 with Java-binaries support
>glibc 2.0.7-19
>
>I installed jdk 1.1.6 to /usr/local/java and created the symlinks
>/usr/bin/java -> /usr/local/java/bin/java and
>/usr/bin/appletviewer -> /usr/local/java/bin/appletviewer

You may find that using SymLinks will cause some problems - depending
on many other things.  It is much better to put /usr/local/java/bin
into your path an make sure that the java/etc are *not* in /usr/bin

>My $CLASSPATH is set to
>".:/usr/local/java/lib:/usr/local/netscape/java/classes/java40.jar"

This can also be a problem.  The Netscape class files are for when
running the Netscape JVM.  Netscape should never need you to define
a classpath at all (do not set CLASSPATH when running netscape and it
will work correctly)

I generally try not to set CLASSPATH or to set it to something as
simple as ".:./obj"  (since I tend to compile my class files into
a different directory tree)

Silly details:

The Java wrapper script will automatically try to find the classes.zip
file (or directory or jar or a whole list of possible places) before
it starts the JVM.  However, it does this by using the $0 (command name)
to find it.  With symlinks the $0 name points to /usr/bin/java (for example)
and this is not where the rest of the Java files are.  You can still
use the symlinks if you also set up a JAVA_HOME to point to where the
Java files are installed.  This normally should not be needed if you
simply put the java/bin directory into your path.

Netscape does equally complex stuff.  It tries to find itself (and there
is a setting but I forgot what it was) and once it does, it does
even more by automatically adding *all* jar files in the directory
where it stores its jar files.  This is so that plug-in and add-on
java things can be done without the CLASSPATH setting.  Note that there
actually is a problem with some versions of Netscape where if you have
CLASSPATH defined at all when Netscape runs it does not try to find its
own Java directories and thus will fail to run Java.  The best thing to
do is not to have CLASSPATH defined when starting Netscape.

All of this is, of course, for the "normal" usage.  Advanced users are
welcome to "shoot them selves in the foot" ;^)

Seriously, this is one of the worst parts about Java.  But it also sometimes
is "needed" in order to try something or do something tricky.  I just wish
it was not abused so many times for things that really did not need to
have special settings.

Michael Sinz -- Director of Research & Development, NextBus Inc.
mailto:[EMAIL PROTECTED] --------- http://www.nextbus.com
My place on the web ---> http://www.users.fast.net/~michael_sinz

Reply via email to