LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 01-08-2013, 01:56 AM   #1
xploreraj
LQ Newbie
 
Registered: Sep 2010
Posts: 7

Rep: Reputation: 0
environment variable in cshell


hi, the default shell of my unix is csh. Now I want to set JAVA_HOME environment variables at root. I have many doubts about this.
1. setting JAVA_HOME for root, will it be different from JAVA_HOME variable of other users?
2. if in some file JAVA_HOME is already set, then setting it again will replace older value?
3. is it set in .cshrc file in home directory of any user for a c shell?
4. What are the commands to set?
5. if set in cshell, do i have to reset the variable for other shells also like bash?

I am a noob here as my doubts signify, but it will be great to have them resolved! Thank you in advance.
 
Old 01-08-2013, 02:22 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,214

Rep: Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696
see here: https://www.ccs.uky.edu/docs/cluster/env.html
or http://www.darkmist.net/~schallee/un...ial/unix7.html
or http://www.gnu.org/software/libc/man...Variables.html
or see the man page of csh
 
1 members found this post helpful.
Old 01-08-2013, 06:41 AM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
1. Setting JAVA_HOME for root, will it be different from JAVA_HOME variable of other users?
No, if everyone's using same path. JAVE_HOME variable carries full path where jave is installed. For a single system it should be same.

2. If in some file JAVA_HOME is already set, then setting it again will replace older value?
Yes, it will.

3. Is it set in .cshrc file in home directory of any user for a c shell?
Depends. It can be set in .cshrc if you're using c shell.

4. What are the commands to set?
For c shell it can be set using:
Code:
setenv JAVA_HOME /path/to/java
5. If set in c shell, do i have to reset the variable for other shells also like bash?
Yes, for every different sheell, you'll once need to set it. For bash, set it in .bashrc or in .bash_profile, as:-
Code:
set JAVA_HOME=/path/to/java; export JAVA_HOME
 
1 members found this post helpful.
Old 01-09-2013, 10:46 PM   #4
xploreraj
LQ Newbie
 
Registered: Sep 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Thank you very much. I have figured it out now!

Last edited by xploreraj; 01-09-2013 at 10:46 PM. Reason: changed smiley. the teeth in :D was not looking white!
 
Old 01-09-2013, 10:51 PM   #5
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Welcome! Please mark the thread as solved (under Thread Tools on the top > Mark the thread as Solved) if you're think your questions have been answered.
 
  


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
keep environment variable manelameur Ubuntu 13 02-05-2010 11:01 PM
Environment Variable khdani Linux - Newbie 1 10-05-2008 10:14 AM
Environment variable.. manomohan Programming 1 02-26-2007 11:27 PM
environment variable gamor Linux - Newbie 4 04-30-2005 05:28 PM
environment variable mimi Linux - Newbie 1 04-10-2002 08:29 AM


All times are GMT -5. The time now is 05:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration