reg - classpath

der.hans PLUG@LuftHans.com
Sat, 24 Feb 2001 11:29:17 -0700 (MST)


Am 23. Feb, 2001 schwäzte suresh k so:

> Can anyone tell me whats the significance of $classpath(what does it mean 

$CLASSPATH is what java uses to find its bytecode class files.

NOTE: This is not case insensitive.

$classpath != $CLASSPATH

> ??does it mean to include any default class path).Then what's the 
> significance of %classpath%.

%classpath% has no significance, it's not valid in a *NIX environment.

>   Whats the funda of executing the .profile using . .profile???

Normally when you execute something the shell spawns a subshell that
actually executes the command. At the end of the command the subshell dies
and returns control to the original shell. This way changes made in the
subshell for the command don't affect the original shell.

Stuff that goes in .profile and other environmental files, however, are
specifically meant to change the current shell.

An example would be if you want to test a program with several different
JDKs you could setup different files for each of them that would set the
$CLASSPATH, $PATH, etc. to what you need for that particular
environment. Say you name these files jdk-x.x, where x.x is the jdk
version, e.g. jdk-1.1 and jdk-1.2. Now to setup your environment
(presuming the jdk-x.x scripts are done properly) you source those files
as appropriate, e.g. '. jdk-1.1'.

Another way for that would be to setup a wrapper script, e.g. java-1.1
would be a script that sets up the environment and then uses the 1.1
jdk. This environment would not affect the parent shell calling it.

ciao,

der.hans
-- 
#  der.hans@LuftHans.com   home.pages.de/~lufthans/   www.YourCompanyHere.net ;-)
# Motorraeder toeten nicht. Motorraeder werden getoetet.