LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to set JAVA_HOME in REDHAT 9.0 Linux? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-java_home-in-redhat-9-0-linux-184719/)

tejpatil 05-23-2004 02:05 AM

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

Bamse123 05-23-2004 02:38 AM

tejpatil,

As root, put it in /etc/profile.

Regards,
Bamse

Bamse123 05-23-2004 02:40 AM

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

tejpatil 05-23-2004 02:48 AM

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.

btmiller 05-23-2004 04:01 AM

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.

tejpatil 05-23-2004 01:17 PM

Thanks. It worked.


All times are GMT -5. The time now is 06:48 PM.