On Tue, Mar 12, 2002 at 03:46:50PM -0500, michael.arolan at excite.com wrote:
> How can I (or how should I) set up the CLASSPATH variable in Redhat
> Linux 7.2. Can I set up on an individual user basis? If I want all the
> users to have the same classpath where would I set it up?  Thanks in
> advance.

Neither.  Use application wrapper scripts.  The java jar files and
classpaths are not as robust as GNU library linking.  Multiple jars can
supply the same class implement, invading eachother's namespaces.
Sometimes this is intentional, sometimes not.  The java compiler and
interpretor are compiled to point to their default classpaths, so you do
not need to specify these.  Given that, it is a far easier thing to do
to set up simple shell wrapper scripts to set up the CLASSPATH
environment variable for a specific application.

    #!/bin/sh -e
    #
    # myapp -- runs app.real after setting environ variables
    #
    java=/usr/bin/java
    javac=/usr/bin/javac

    # set up classpath if not already set -- let users set their own
    CLASSPATH=${CLASSPATH:-/usr/share/myapp/}
    export CLASSPATH
    
    # Run app w/commandline options from script arguments
    $java $@

    # end script -- exits w/exit code from java app
    
-- 
Chad Walstrom <chewie at wookimus.net>                 | a.k.a. ^chewie
http://www.wookimus.net/                            | s.k.a. gunnarr
Get my public key, ICQ#, etc. $(mailx -s 'get info' chewie at wookimus.net)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://shadowknight.real-time.com/pipermail/tclug-list/attachments/20020312/52afe3a6/attachment.pgp