LinuxQuestions.org
Help answer threads with 0 replies.
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 01-15-2006, 09:05 PM   #1
RArocks12
LQ Newbie
 
Registered: Dec 2005
Location: NY
Posts: 7

Rep: Reputation: 0
Problems installing java


I'm relatively new to linux and I recently installed redhat enterprise 4. I wanted to install java so I could do a little programming but I ran into a problem setting the path. After reading through pages found on google and searching through this forum I put the following code into the /etc/bashrc file:

JAVA_HOME=/usr/java/jdk1.5.0_06
PATH=${JAVA_HOME}/bin:PATH
export PATH

Now I cannot use any commands like ls, vi, or su. Because I can't use su, I cannot figure out a way to remove this code from the bashrc file. How can I fix this and what do I need to put in place of this code?
 
Old 01-15-2006, 10:02 PM   #2
sohmc
Member
 
Registered: Aug 2002
Location: Alexandria
Distribution: ubuntu 12.04.2
Posts: 217

Rep: Reputation: 30
your path should look like this:
PATH=${JAVA_HOME}/bin:${PATH}

Also, probably a saner way to do this is to symlink ${JAVA_HOME}/bin in a directory in your path, e.g. /usr/bin

you can do this as root:
# ln -s /usr/java/jdk1.5.0_06/bin/* /usr/bin
 
Old 01-15-2006, 10:15 PM   #3
RArocks12
LQ Newbie
 
Registered: Dec 2005
Location: NY
Posts: 7

Original Poster
Rep: Reputation: 0
Thank you very much, but do you know of any way that I could edit the bashrc file? I cannot use the su command to enter the root password and it is read-only file without the password.
 
Old 01-15-2006, 11:47 PM   #4
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Type the whole path, i.e.:

Code:
/bin/su
Use something like "find" or "locate" to find the full path if that doesn't work. All the PATH environment variable does is allow you to enter the name of a binary without specifying the full path.
 
Old 01-16-2006, 12:19 AM   #5
RArocks12
LQ Newbie
 
Registered: Dec 2005
Location: NY
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Also, probably a saner way to do this is to symlink ${JAVA_HOME}/bin in a directory in your path, e.g. /usr/bin

you can do this as root:
# ln -s /usr/java/jdk1.5.0_06/bin/* /usr/bin
Sorry, but I don't quite understand this. I deleted the chunk of code I had in the bashrc file and my commands work. This is probably a stupid question but where do I put in this?

Code:
# ln -s /usr/java/jdk1.5.0_06/bin/* /usr/bin
 
Old 01-16-2006, 12:25 AM   #6
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
That line will make symbolic links ("shortcuts" in Windows-speak) of all your Java executable files in /usr/bin, which is a directory in your PATH. That way, you wouldn't have to add $JAVA_HOME/bin to your PATH in the first place and it would still all work. It's just a different way of accomplishing the same thing, if you don't want to add an extra directory to your PATH and instead make sure that only the files in $JAVA_HOME/bin now (not any added in the future) will be runnable without typing their full path.

--EDIT--
That would be something you'd type in the shell as root, not put in any file. See "man ln".

Last edited by jrdioko; 01-16-2006 at 12:26 AM.
 
  


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
installing java problems cold95 Ubuntu 1 12-28-2005 08:30 PM
Problems installing java 1.3.1_16 UmneyDurak Fedora 3 09-28-2005 08:43 AM
Problems installing Java ursinus Linux - Newbie 21 08-25-2005 11:21 AM
problems with installing java 5 supersucker Linux - Software 2 12-05-2004 01:32 PM
problems installing java bond82 Linux - Software 8 08-30-2004 11:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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