LinuxQuestions.org
Review your favorite Linux distribution.
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
 
LinkBack Search this Thread
Old 02-17-2003, 04:04 PM   #1
JMCraig
Member
 
Registered: Feb 2003
Location: Utah, USA
Distribution: Red Hat EL/CentOS, Ubuntu/Debian
Posts: 113

Rep: Reputation: 15
Question "set an environment variable"


Hi Folks,

Linux is so easy if you know the command you want and why you want it....

But in the install instructions for a package I'm messing with at the moment it says to:

Set an environment variable JAVA_HOME to the pathname of the directory into which you installed the JDK release.

Now, that's not a problem, per se, but won't that environment variable be needed after the terminal session I'm in during the install closes and goes away?

How do I set something up in the environment so that it's part of the normal boot-up sequence? If I just installed the JDK (which made its own mind up about where it wanted to be) is it already there and I just don't know it?

I'm on RH 8.0 (since I blew up my nicely working 7.1 install, which I did a LONG time back), I just need to get things working again (in this case Tomcat4).

Thanks!

John
 
Old 02-17-2003, 04:12 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,344

Rep: Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945Reputation: 1945
add "export JAVA_HOME=blah" to the end of /etc/rc.local
 
Old 02-17-2003, 04:14 PM   #3
JMCraig
Member
 
Registered: Feb 2003
Location: Utah, USA
Distribution: Red Hat EL/CentOS, Ubuntu/Debian
Posts: 113

Original Poster
Rep: Reputation: 15
Whoops; didn't do a comprehensive enough search--edit etc/profile, right?

Looks to me like I need a line like this:

JAVA_HOME=/usr/java/j2sdk1.4.1_01

and then the JAVA_HOME variable needs to be listed in the EXPORT line as one of the entries.

Is that it?

Tah,

John
RH8 clue-
 
Old 02-17-2003, 04:20 PM   #4
JMCraig
Member
 
Registered: Feb 2003
Location: Utah, USA
Distribution: Red Hat EL/CentOS, Ubuntu/Debian
Posts: 113

Original Poster
Rep: Reputation: 15
Okay, so what's the diff?

Can you give me a quickie explanation of the difference between /etc/rc.local
and
/etc/profile

Thanks!

JMC
 
Old 02-17-2003, 04:24 PM   #5
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
/etc/rc.local will set the variable during boot up, this should set it for whatever user (or maybe all?) you run the process as;
/etc/profile is used to set global environment variables (I personally would have suggested /etc/profile but obviously would have been wrong ) and global "settings" for all users.

Cool
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql: Can't set the "skip_networking" variable BrianK Linux - Software 6 07-15-2005 07:22 PM
set, env, source & "completely empty environment..." ? na5m Linux From Scratch 1 01-28-2005 03:29 AM
"PKG_CONFIG_PATH environment variable" huh? plz help David_g17 Linux - Software 3 09-30-2004 06:33 PM
"MOZILLA_FIVE_HOME" environment variable cougyr Linux - Software 2 12-06-2003 11:51 PM
How can I do some modification to my initialized "env" environment variable? yuzuohong Linux - General 3 12-18-2002 03:41 PM


All times are GMT -5. The time now is 08:24 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