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 05-23-2004, 03:05 AM   #1
tejpatil
Member
 
Registered: Feb 2004
Posts: 43

Rep: Reputation: 15
How to set JAVA_HOME in REDHAT 9.0 Linux?


I was trying to set JAVA_HOME in profile file, but unable to decide where to put the java_home path. Can anyone guide me?

J2sdk and JRE are in /USR/JAVA
 
Old 05-23-2004, 03:38 AM   #2
Bamse123
Member
 
Registered: Apr 2003
Location: Rovaniemi, Finland
Distribution: Slackware
Posts: 69

Rep: Reputation: 15
tejpatil,

As root, put it in /etc/profile.

Regards,
Bamse
 
Old 05-23-2004, 03:40 AM   #3
Bamse123
Member
 
Registered: Apr 2003
Location: Rovaniemi, Finland
Distribution: Slackware
Posts: 69

Rep: Reputation: 15
Quote:
I was trying to set JAVA_HOME in profile file...
...Was that what you asked? So if you have e.g. J2RE installed in /usr/java, then that's your path. set JAVA_HOME=/usr/java.

Regards,
Bamse
 
Old 05-23-2004, 03:48 AM   #4
tejpatil
Member
 
Registered: Feb 2004
Posts: 43

Original Poster
Rep: Reputation: 15
Hi,

I did that, but I cannot execute java command from root.



profile file changes:
####################################################
#JAVA_HOME
JAVA_HOME=/usr/java/j2sdk1.5.0
###################################################


export JAVA_HOME


---------------------------------------------
I did check the profile attributes it look like this:

-rw-r--r-- 1 root root 1009 May 22 23:46 profile

Is this correct.
 
Old 05-23-2004, 05:01 AM   #5
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
If you want to execute commands in $JAVA_HOME/bin, you'll need to add it to your PATH as well, e.g.:

export PATH=$PATH:$JAVA_HOME/bin

You can also just type the full path name of the command.
 
Old 05-23-2004, 02:17 PM   #6
tejpatil
Member
 
Registered: Feb 2004
Posts: 43

Original Poster
Rep: Reputation: 15
Thanks. It worked.
 
  


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 workgroup in linux redhat 9 vanhelsing Linux - Networking 4 09-03-2004 06:08 PM
How to set JAVA_HOME in REDHAT 9.0 Linux? tejpatil Linux - General 1 05-23-2004 07:32 AM
JAVA_HOME path not set for all users tantric Linux - Software 5 03-29-2004 02:25 PM
RedHat 8 Linux Lab Network Set Up Help Mike65 Programming 6 02-23-2003 12:17 PM
how to set iptables in redhat linux 7.1 cmardhekar Linux - General 3 08-25-2001 12:25 AM


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