How to override Classpath?

Hi,

When I login to my HP-UX and fire the "set" command I see that the weblogic 9.2 classpath is already set.

However, I wish to override the classpath to weblogic version 10.3

I have a script call setWLSEnv.sh that has the desired classpath.

Thus, in my unix script i write

 
 
. /tmp/wls103/server/bin/setWLSEnv.sh
java weblogic.version

But this happens to give me the version of weblogic 9.2 which means that the CLASSPATH still remains that of 9.2.

How can I override the CLASSPATH to whichever script that has the CLASSPATH I wish to ?

Could you post what how CLASSPATH gets set in /tmp/wls103/server/bin/setWLSEnv.sh ?

From PID i extract the path using ps command.

So i get /tmp/wls103/ from grepping pid and I store it in a variable wls_home.

This is how i try to run the setwlsEnv.sh in unix script

 
. $wls_home/server/bin/setWLSEnv.sh

That is not what I asked..

Looks like it does set the new CLASSPATH but is not able to override the old CLASSPATH. Thus, it seems like although

 
echo ${CLASSPATH}
/tmp/bea103/wlserver_10.3/server/lib/weblogic.jar

it takes

 
/tmp/bea92/wlserver92/server/lib/weblogic.jar

into consideration.
Please help !!

We want to see the contents of that file. Without seeing it, we're only guessing at what you've done here.

Did you actually export that variable, or just set it? If you don't export it, it's just a local variable and doesn't get passed into any processes you create.

VAR=value
export VAR

I did paste the contents but for some reason I dont see my post reflected. Posting the contents again

######################################

WL_HOME="/tmp/bea103/wlserver_10.3"
export WL_HOME

. "${WL_HOME}/common/bin/commEnv.sh"

# Check that the WebLogic classes are where we expect them to be
if [ ! -f "${WL_HOME}/server/lib/weblogic.jar" ]; then
  echo
  echo "The WebLogic Server wasn't found in directory ${WL_HOME}/server."
  echo "Please edit the startWebLogic.sh script so that the WL_HOME"
  echo "variable points to the WebLogic installation directory."

# Check that java is where we expect it to be
elif [ ! -d "${JAVA_HOME}/bin" ]; then
  echo
  echo "The JDK wasn't found in directory ${JAVA_HOME}."
  echo "Please edit the startWebLogic.sh script so that the JAVA_HOME"
  echo "variable points to the location of your JDK."

else

CLASSPATH="${WEBLOGIC_CLASSPATH}${CLASSPATHSEP}${CLASSPATH}"
export CLASSPATH

# Import extended environment

if [ -f extEnv.sh ]; then
  . extEnv.sh
fi
if [ ! -z "${EXT_PRE_CLASSPATH}" ]; then
  CLASSPATH="${EXT_PRE_CLASSPATH}${CLASSPATHSEP}${CLASSPATH}"
fi
if [ ! -z "${EXT_POST_CLASSPATH}" ]; then
  CLASSPATH="${CLASSPATH}${CLASSPATHSEP}${EXT_POST_CLASSPATH}"
fi

if [ ! -z "${EXT_PRE_PATH}" ]; then
  PATH="${EXT_PRE_PATH}${PATHSEP}${PATH}"
fi
if [ ! -z "${EXT_POST_PATH}" ]; then
  PATH="${PATH}${PATHSEP}${EXT_POST_PATH}"
fi

# Get PRE and POST environment
if [ ! -z "${PRE_CLASSPATH}" ]; then
  CLASSPATH="${PRE_CLASSPATH}${CLASSPATHSEP}${CLASSPATH}"
fi
if [ ! -z "${POST_CLASSPATH}" ]; then
  CLASSPATH="${CLASSPATH}${CLASSPATHSEP}${POST_CLASSPATH}"
fi

if [ ! -z "${PRE_PATH}" ]; then
  PATH="${PRE_PATH}${PATHSEP}${PATH}"
fi
if [ ! -z "${POST_PATH}" ]; then
  PATH="${PATH}${PATHSEP}${POST_PATH}"
fi

echo CLASSPATH=${CLASSPATH}
echo
echo PATH=${PATH}
echo
echo "Your environment has been set."

fi
#####################################################