Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Java, Installing Java SDK.
untz
post Oct 30 2003, 07:11 PM
Post #1


Grub-er
**

Group: Members
Posts: 33
Joined: 30-October 03
Member No.: 1,725



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
Go to the top of the page
 
+Quote Post
chrisw
post Oct 30 2003, 10:35 PM
Post #2


RMS is my Hero
******

Group: Admin
Posts: 634
Joined: 27-September 02
From: Louisiana
Member No.: 5



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


--------------------

Chris W.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd October 2017 - 07:31 PM