Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i have RedHat 6.2 + kernel 2.2.14-5

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
i have RedHat 6.2 + kernel 2.2.14-5.0 + GNU bash, version 1.14.7(1)

i want to add the path ( i am root): '/home/yyy' to my $PATH. i just add it to
my
/etc/profile file like this
PATH="$PATH:/usr/X11R6/bin:/usr/local/jdk1.2.2/bin:./:/home/yyy"
OK but
1-How to make my linux execute that witout rebooting?
2-Can i make this by terminal without editing /etc/profile ?
i have tried setenv PATH /etc/yyy:$PATH
but i get the message "bash: setenv:command not found"

Another Question
3-How to add /home/yyy to my $CLASSPATH in /etc/profile?, i havn't find
$CLASSPATH !!!
4-How to make my linux execute that witout rebooting?


Thanks for all
NB: I must do that to install and use commapi from SUN to use ttyS0 JAVA
 
1. Log out and log back in ... That will re-set this

2. Just do : export PATH=$PATH:/home/yyy

3. just do CLASSPATH=$CLASSPATH:/home/yyy

Then, look for a line that says:

export PATH XXX YYY ZZZ AAA BBB and add CLASSPATH to that.

4. Log out and log back in.
Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.
 
In addtion to the above, when doing Java development in Linux with large amounts $CLASSPATH data.....(assuming your using bash)

Setup a file /etc/profile.d/java.sh and in that put all your classpath stuff, this file will get executed every time you log-in so that the classpath will be setup & ready to go.

Here's mine (note the line: CLASSPATH="." ) is important:

# Java1.2.2 initialization script (sh)

# Root paths and the JDK
JAVA_ROOT="/usr/java"
JAVA_HOME="$JAVA_ROOT/jdk1.3"
JAVA_PATH="$JAVA_HOME"

# Sub paths for java APIs
SWING="$JAVA_ROOT/swing-1.1.1fcs"

# Application specific sub paths
JDBC_HOME="$JAVA_ROOT/jConnect-5_2"
JEXT_HOME="/usr/local/jext"
RESIN="/opt/resin1.2.1"

# Application specific variables

RESIN_HOME="$RESIN"
PROTEUS_HOME="/zroot/system/proteus"
PROTEUS_LIB="$PROTEUS_HOME/proteus/lib"
PROTEUS_CONF="$PROTEUS_HOME/proteus/conf"

# Adds the java executables to $PATH
PATH="$JAVA_HOME/bin:$PATH"

# Buils the classpath
CLASSPATH="."
CLASSPATH="$CLASSPATH:$JAVA_HOME/jre/lib/rt.jar"
CLASSPATH="$CLASSPATH:$JAVA_HOME/lib/tools.jar"

CLASSPATH="$CLASSPATH:$SWING/swingall.jar"

CLASSPATH="$CLASSPATH:$RESIN/lib/resin.jar"
CLASSPATH="$CLASSPATH:$RESIN/lib/jsdk22.jar"
CLASSPATH="$CLASSPATH:$RESIN/lib/jdk12.jar"
CLASSPATH="$CLASSPATH:$RESIN/lib/jndi.jar"

CLASSPATH="$CLASSPATH:$JDBC_HOME/classes"
CLASSPATH="$CLASSPATH:$JDBC_HOME/classes/jconn2.jar"

CLASSPATH="$CLASSPATH:$PROTEUS_HOME"
CLASSPATH="$CLASSPATH:$PROTEUS_HOME/proteus/pdc"

CLASSPATH="$CLASSPATH:$PROTEUS_LIB/mail.jar"
CLASSPATH="$CLASSPATH:$PROTEUS_LIB/xalan.jar"
CLASSPATH="$CLASSPATH:$PROTEUS_LIB/xerces.jar"
CLASSPATH="$CLASSPATH:$PROTEUS_LIB/activation.jar"
CLASSPATH="$CLASSPATH:$PROTEUS_LIB/IBM-SOAP.jar"
CLASSPATH="$CLASSPATH:$PROTEUS_LIB/bsf.jar"
CLASSPATH="$CLASSPATH:$PROTEUS_LIB/bsfengines.jar"
CLASSPATH="$CLASSPATH:$PROTEUS_LIB/gnu-regexp-1.1.1.jar"
CLASSPATH="$CLASSPATH:$PROTEUS_LIB/smtp.jar"
CLASSPATH="$CLASSPATH:$PROTEUS_LIB/PGP26_0-1-1.jar"
CLASSPATH="$CLASSPATH:$PROTEUS_LIB/SECVPNBoot.jar"
CLASSPATH="$CLASSPATH:$PROTEUS_LIB/servlet.jar"
CLASSPATH="$CLASSPATH:$PROTEUS_LIB/RSA_0-1-1.jar"
CLASSPATH="$CLASSPATH:$PROTEUS_LIB/OLD_0-2-0.jar"

#CLASSPATH="$CLASSPATH:$PROTEUS_LIB/ao.jar"
#CLASSPATH="$CLASSPATH:$PROTEUS_LIB/pm.jar"

CLASSPATH="$CLASSPATH:$JEXT_HOME/lib/jext.jar"

# Export the environment variables
export JAVA_HOME JAVA_PATH RESIN XALAN RESIN_HOME CLASSPATH PATH JEXT_HOME PROTEUS_CONF JDBC_HOME
 
thanks mbaranski & Tardigrade
i have sent the same message by mistake :(
i am saving this page to read it later at home. thank you for all
good luck for all Linux lover!
 
Hmm, try to add it to /etc/bashrc

Then it will be loaded each time you log in. So you just logout and then in again :)

/Alexander
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top