LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-18-2005, 10:58 AM   #1
pkpro1
LQ Newbie
 
Registered: Mar 2005
Posts: 2

Rep: Reputation: 0
problem setting JAVA_HOME


hi, i did the following to set the java_home...

export java_home=/usr/java/j2re1.4.2_2
export PATH=$java_home/bin:$PATH

HOWEVER,

every time i open a new shell and type 'java'.... it says command not found. the java_home only works for the specific shell that i set it for. is there a way to make the java command a universal variable?
 
Old 07-18-2005, 01:15 PM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 58
i believe its because once you set it, it is only available for the time that the shell is open.. once you close it you would have to set it up again.
however, there should be a '.bashrc' file in your home folder, edit that. you will see the "PATH="... variable declared there, just add your java_home one before that, and edit the path like you did in your post, to include $java_home in the $path.
 
Old 07-18-2005, 03:53 PM   #3
pkpro1
LQ Newbie
 
Registered: Mar 2005
Posts: 2

Original Poster
Rep: Reputation: 0
awesome. that worked like a charm
 
Old 11-25-2007, 07:32 AM   #4
DinoFly
Member
 
Registered: Nov 2007
Distribution: Fedora, CentOS,
Posts: 72

Rep: Reputation: Disabled
Quote:
Originally Posted by pkpro1 View Post
awesome. that worked like a charm
But if I wana set up JAVA_HOME envirement for everybody who logs on my server is it the path /etc/bashrc ??? Just curious
 
Old 11-25-2007, 08:39 AM   #5
DinoFly
Member
 
Registered: Nov 2007
Distribution: Fedora, CentOS,
Posts: 72

Rep: Reputation: Disabled
Quote:
Originally Posted by DinoFly View Post
But if I wana set up JAVA_HOME envirement for everybody who logs on my server is it the path /etc/bashrc ??? Just curious
Yep for those who wants to set up JAVA_HOME for all users on the server add 2 lines on /etc/bash.rc

export JAVA_HOME="pathtothejavadirectorium ex. /usr/java/jdkx.x.x/jre"
export PATH=$JAVA_HOME/bin:$PATH

I'm a rookie plz if some1 has a different opinion plz correct me.


Best regards
 
Old 11-25-2007, 08:49 AM   #6
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Either /etc/bashrc or /etc/profile is the most common place for global environment for users who might not have their own .bashrc or .bash_profile in their home directory.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
setting JAVA_HOME gauravbagga Linux - Newbie 2 03-04-2005 09:17 PM
JAVA_HOME Variable yea420 Linux - Software 6 08-29-2004 06:37 PM
Permanently Setting the Java_Home Dynapen Linux - Newbie 2 08-04-2004 01:53 PM
Opera Startup + Setting JAVA_HOME l2g Linux - Newbie 2 03-07-2004 05:43 AM
PATH and JAVA_HOME peteABK Linux - Newbie 4 10-19-2003 04:30 PM


All times are GMT -5. The time now is 09:49 AM.

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