LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-21-2003, 07:42 PM   #1
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Rep: Reputation: 30
How to set a environment variable in rh?


Dear all,

i want to set some environment variable to rh. then how?

Thanks in advance!

Cheers,
yenonn
 
Old 02-21-2003, 08:18 PM   #2
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
You want to set some environmental variables in RedHat? Are you referring to a shell environment?
 
Old 02-21-2003, 08:28 PM   #3
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
i don't know what should it be.

in windows, i can set path, such as:

set PATH=d:\java\jdk1.4.0\bin;d:\ant\bin
set ANT_HOME=d:\ant
set JAVA_HOME=d:\java\jdk1.4.0

but, i am totally new to rh8, if i want to do something like this. then, how can i get it right?

Cheers,
yenonn
 
Old 02-21-2003, 08:35 PM   #4
nakkaya
Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
so you want to create a link right?
like file is located somewhere but you want to make it look like elsewhere did i get it right
 
Old 02-21-2003, 08:36 PM   #5
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
well, to check your path you can use:
$PATH

to edit your path:
export $PATH=/bin:/home/usr/bin:etc...
or
export $PATH=$PATH:/home/usr/bin (which adds the last entry to your original path).

Now for these others, I'm not sure what you're trying to do....you see, some program has to actually *use* these environments you'd be setting. You can just about export anything, but its pointless unless you use it. So, check the scripts to determine what variables are being used and work from there. Also, if you're making your own scripts, you dont need to export variables on the command line, but instead in the script.

maybe you could tell us the context that this came up under...
 
Old 02-21-2003, 08:56 PM   #6
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
ok, all i want to do is like this.
i want to setup a java environment for my linux redhat...
i have downloaded and installed the java standard development kit 1.4.0.0.1 from www.java.sun.com. then, i want to set some environment variables like JAVA_HOME,... and etc. to the system. (i did that in windows 98). so, does ur solution hits my need?
if so, thanks, else, what should be then?
 
Old 02-21-2003, 09:11 PM   #7
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
i think nakkaya is near to my thinking...
 
Old 02-21-2003, 09:17 PM   #8
nakkaya
Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
you have to create a sym link if you are using gnome and kde find the file you want to link and right click it then choose create link or some think like that i am not using both so i am not sure the name but i know there is a entry like that then drag and drop it where you want to link it
 
Old 02-21-2003, 09:25 PM   #9
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
ok,
1. If this is a program that you're running, you can create an alias in ~/.bashrc
something like:
alias cool_name=/boring/long/path/to/boring/name

2. But I think what you are doing is trying to change the default paths/or variables for already made scripts. See my earlier post: these names dont do much unless you know what they are exactly (for example your JAVA_HOME).
now, there are 2 ways:
you can try a
"export $JAVA_HOME=whatever this is supposed to be"

or try locating the oiginal/universal copy:
"grep JAVA_HOME /etc/"
then just edit the config file grep finds.

3. If there is no config file found, maybe variables like "JAVA_HOME" (again...I dont know how hava works) is set during install. then you'll ether have to go back to 2, or even more-so you may have to install from source, editing the make file before you compile.
 
Old 02-21-2003, 09:35 PM   #10
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
looking at your previous post:

Code:
set PATH=d:\java\jdk1.4.0\bin;d:\ant\bin
set ANT_HOME=d:\ant
set JAVA_HOME=d:\java\jdk1.4.0
my #1 or #2 looks like what you're looking for (assuming this is a program).
 
Old 02-21-2003, 09:40 PM   #11
yenonn
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Redhat 8.0, 9, Slackware 9.1
Posts: 511

Original Poster
Rep: Reputation: 30
thanks cuckoopint,
thanks... you have given me a clear picture...

Cheers,
yenonn
 
Old 02-21-2003, 10:24 PM   #12
cuckoopint
Member
 
Registered: Feb 2003
Distribution: Debian
Posts: 797

Rep: Reputation: 30
glad to help and hope it works out.

*note to self: must take on java one of these days.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to set a value of environment variable? ukrainet Linux - Newbie 1 12-28-2004 04:33 AM
How to set an environment variable? dantemarmol Linux - Newbie 7 08-22-2003 10:59 AM
Set Environment Variable lloyd_stevens Linux - Software 1 07-30-2003 12:38 PM
how to set CC environment variable mr.moto General 2 12-18-2001 01:02 AM
how do you set the environment variable CC? mr.moto Linux - General 0 12-17-2001 09:17 PM


All times are GMT -5. The time now is 03:26 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration