Same as for other Linux/Unix systems. The differences are in pathname format (slashes, not backslashes, just like all other *nix pathnames) and use of the ":" (colon) as a pathname separator instead of the ";" (semicolon). Set the environment variable as follows:
CLASSPATH=/usr/local/javajars/mydbc.jar:/usr/local/javaclasses:.
export CLASSPATH
(varies slightly depending on which shell you're using). You can and often will put this in your login script.
Note that in the example, the last path was ".", meaning look in the current directory. Which you may or may not want to do, but If you don't, the current directory won't be used.
For
java command purposes, you can also do:
javac -classpath /usr/local/moreclasses:/usr/local/javajars/neatstuff.jar MyClass.java
I'd have to doublecheck, but I think that that completely overrides the CLASSPATH environment, so to get a cumulative classpath, you'd have to do:
javac -classpath $CLASSPATH:/usr/local/moreclasses:/usr/local/javajars/neatstuff.jar MyClass.java
[ May 14, 2002: Message edited by: Tim Holloway ]