Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-11-2004, 02:43 AM   #1
LQ Newbie
Registered: May 2003
Location: Columbia, MO
Distribution: redhat 7.3
Posts: 11

Rep: Reputation: 0
Installing Java SDK 1.4.2_05

Hello all-
I'm new with installing programs on linux and I have some questions hopefully someone can help me out with. I'm trying to install Java SDK so I can do some programming assignments at home. After following the install instructions I was under the impression I could use some commands like javac, java, etc. I keep getting command not found errors though. So I checked several things:
1.I looked in /var/lib/rpm: java sdk wasn't in there.
2. Next I tried these commands to uninstall and then reinstall:

try to remove it so i can reinstall:
rpm -e j2sdk-1_4_2_05-linux-i586.rpm
error: package j2sdk-1_4_2_05-linux-i586.rpm is not installed

try to install:
rpm -iv j2sdk-1_4_2_05-linux-i586.rpm
Preparing packages for installation...
package j2sdk-1.4.2_05-fcs is already installed
I executed these commands one right after the other. How is it possible that this can be correct? Basically from my understanding it is saying that j2sdk is not installed, and that it is installed. Does anyone know what I'm doing wrong? Thanks in advance for any help.
Old 09-11-2004, 02:53 AM   #2
Senior Member
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
you don't use the rpm filename to uninstall. you need to use the package name.


rpm -e j2sdk

if you need to be more exact with the package name, use:

rpm -qa | grep j2sdk

the output is the exact package name for the java sdk that you can use 'rpm -e' on.
Old 09-11-2004, 02:56 AM   #3
LQ Newbie
Registered: Sep 2004
Distribution: gentoo
Posts: 6

Rep: Reputation: 0
okay, before you read the rest of this, try typing "source /etc/profile" into a shell. now does java or javac give you any output? if so, cool. if not...

I'm not sure about package management for your specific distro, but try this:

as root:
(it'll take about 5 minutes -- it builds a database of everything on your system, which will make future file searching fast)

locate javac
Note: if you don't have root access on the machine, you can always run
find / |grep javac
but it's sloooooow...

anyway, let's say it found java in /opt/sun-jdk-1.4.2_05/bin/javac
then you want your JAVA_HOME to be /opt/sun-jdk-1.4.2_05

if it was found in /usr/local/bin, on the other hand, ignore the rest of this, and simply add /usr/local/bin to your PATH variable.

Now that you know where java is, open up your .bashrc file in a text editor (assuming you're using bash. type "echo $SHELL" to find out your shell, and if it's csh, edit .cshrc, and likewise).

add the following lines to the file:
export JAVA_HOME=/path/we/just/discussed
export PATH=$PATH:$JAVA_HOME/bin
Old 09-11-2004, 04:29 AM   #4
LQ Newbie
Registered: May 2003
Location: Columbia, MO
Distribution: redhat 7.3
Posts: 11

Original Poster
Rep: Reputation: 0

Thanks for all the help. I got it all worked out now.
I have one other question maybe someone can explain for me. I found a tutorial about how to edit /etc/profile.d/ I created that file and put the location of java in for my PATH variable. What I was wondering is if you have to do that for each program you install, or if I should just try to install all of my programs in one of the paths already set up in PATH. Thanks again.
Old 09-11-2004, 04:39 AM   #5
Senior Member
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
java is one of the only things i know of that requires editing of the profile script to get the path set. i personally like to use pathmunge for setting the java path globally for all users.

but aside from java, other compilers might require you to set the path so you can use the unqualified program name (start program without having to specify a fully qualified path to the executable). i set up the path for intel's c++ compiler the same way i set it up with java.

but for regular, non-compiler programs, if you compile the programs from source and the program uses configure script in it's install process, you won't usually need to set the path for using it by using the correct path for the --prefix option. it basically depends on where you install the software at, since linux has some predetermined locations to search through.


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
Several questions: In short Java SDK, Dual Boot with XP and Installing Nvidia Drivers cuscus1986 Linux - Newbie 4 01-08-2005 03:50 PM
Mozilla Java issue (1.7.3, J2sdk1.4.2_05) JCdude2525 Linux - General 1 11-19-2004 02:14 AM
Installing JAVA SDK 1.3 on RedHat7.3 jenze76 Linux - Software 2 08-15-2004 10:31 AM
JAVA:problem in installing ECLIPSE SDk on LINUX nedian123 Programming 1 06-26-2004 09:37 PM
Installing Java SDK 1.4.2 grrr........... hadding Linux - Newbie 1 11-09-2003 07:25 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:23 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration