LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 11-25-2006, 06:49 AM   #1
Thor
LQ Newbie
 
Registered: Nov 2006
Distribution: CentOS, OpenSuSE
Posts: 4

Rep: Reputation: 0
CentOS 4.4 saving PATH, CLASSPATH variables


When logged in via SSH as root I can do the following:

Code:
export set PATH=$PATH:/usr/local/java/SDK/jdk/bin
Allowing this to work:
Code:
javac file.java
However, when I log out then return and log in later the PATH system variable has reverted back to the default. The same applies for CLASSPATH

Is there anyway of permanently saving these system variables?
 
Old 11-25-2006, 07:53 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
You can put the commands in the users ~/.bash_profile or globally in /etc/profile. An alternative, which I think is better because you don't have to edit any of the original configuration files, is to create a script in /etc/profile.d call is something like java.sh and make it executable. Put the commands below
Code:
export PATH=$PATH:/usr/local/java/SDK/jdk/bin
and those of of your CLASSPATH variable. Logout and back in again or do "source /etc/profile".
 
Old 11-25-2006, 08:55 AM   #3
Thor
LQ Newbie
 
Registered: Nov 2006
Distribution: CentOS, OpenSuSE
Posts: 4

Original Poster
Rep: Reputation: 0
Thumbs up

Cheers mate, that worked perfectly!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash: Saving and Variables morrolan Linux - Newbie 1 03-20-2006 11:03 AM
KDE not saving certian environmental variables paranoid times Linux - Software 4 03-03-2006 12:15 AM
Saving User-Created Variables feetyouwell Programming 3 02-15-2004 09:56 PM
How to set PATH and CLASSPATH environment variables bronko Linux - Newbie 2 12-20-2003 11:13 AM
set up path,classpath in linux(slaware9) for java Manjula.S Linux - Software 5 10-06-2003 11:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 06:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration