On my windows system I use batch files to setup different paths to use different jre's and jdk's. I set up a script on Linux but it doesn't seem to be adjusting my path. Does anybody know how to do this. Here is my jdk122.sh # Set Java Enviroment JAVA_HOME=/usr/java/jdk122 export JAVA_HOME CLASSPATH=. export CLASSPATH JDK_HOME=$JAVA_HOME export JDK_HOME JES_INSTALL_DIR=/home/kevin/java/jes2.0 export JES_INSTALL_DIR JES_JAVA_HOME=$JAVA_HOME export JES_JAVA_HOME # Set Path PATH=$JAVA_HOME/bin:$PATH export PATH
Varun Narula
Ranch Hand
Joined: Nov 19, 2001
Posts: 90
posted
0
maybe you need to add the classpath variables too. the classpath currently has been set only for the current directory(.) try adding $JAVA_HOME/jre/lib/rt.jar and tools.jar to your classpath Hope that helps ! Varun Narula
There are only 10 types of people in this world; those who understand binary and those who dont<p>Varun Narula <br />SCJP, SCWCD, IBM-486 (UML)
Steve Deadsea
Ranch Hand
Joined: Dec 03, 2001
Posts: 125
posted
0
The only thing I can think of is to add quotes: PATH="$JAVA_HOME/bin:$PATH" export PATH
Guy Allard
Ranch Hand
Joined: Nov 24, 2000
Posts: 776
posted
0
Hi - If you are invoking the script like: jdk122.sh # it is in PATH *or* ./jdk122.sh # it is not in PATH then the shell forks and execs a new shell to run the script, which ends, and you are right back to where you started. To properly set environment variables for the running shell, do: . ./jdk122.sh HTH, Guy