Help - Search - Members - Calendar
Full Version: Java
Linuxhelp > Support > Technical Support
untz
Hello,

I installed the Java 2 SDK 1.4.2_02 into my Linux Distro (Red Hat 9.0) as "root"

It installed itself in /usr/java/j2sdk1.4.2_02

I then setup my .bash_profile as:

-----------------------------------------------------------------------
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

JAVA_HOME=/usr/java/j2sdk1.4.2_02
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME="root"

export USERNAME BASH_ENV PATH JAVA_HOME
----------------------------------------------------------------------------------

Now, everything works well as "root" but when I login as "untz" and type java -version at the command prompt, its not recognized.

Do I have to re-install it as "untz"? I just want access to my CLASSPATH & JAVA_HOME & PATH system environmental variables (I know that I didn't define a CLASSPATH in the .bash_profile, but I will soon), when I login as "untz" I use "root" to install things but want to use Red Hat as "untz".

Any help, suggestions, hints will be greatly appreciated....

-Unnsse
chrisw
you dont edit your .bash_profile...

you place the java_home java_path info
in the /etc/profile.d/java.sh file

in that file put the following

export JAVA_HOME=/usr/java/j2sdk1.4.2_02
export PATH=$PATH:$JAVA_HOME:$JAVA_HOME/bin


that way you can use the java commands under any user
that logs in

i forgot...after you create the file and add what i told you...
save it and the type the following at a command line

source java.sh
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.