installing java on Linux

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Kevin Brown
Date:  
Subject: installing java on Linux
> I have recently installed the Linux java RE rpm from Sun's website, or
> at least I thought I did. after trying to run a java program I've
> written, the command "java" could not be found. I tried the "which
> java" command, which told me java was not installed. I made my way to
> /usr/java, where the RE and SDK packages had all sorts of binary files
> and system libraries. Unfortunately, I don't know where they all go,
> although I thought the rpm would have taken care of that. A friend of
> mine said I should install java "from scratch," but I don't know where
> to start. Any suggestions?


Biggest reason you can't find java, it isn't in your PATH yet. If you want to
see where the rpm stuck everything you could run rpm -ql <package name> and it
will show you where all the files went. Environment variables like PATH can be
changed by rpms, but you won't see the effect until you relog (of if looking at
an Xterm, close the term and open it back up). If you want to know where java
itself is, run:

updatedb
locate java | grep bin/

Then you can just do /path/to/javabin/java to use it or add that path to PATH:

export PATH=$PATH:/path/to/javabin

javabin means the bin directory that holds java.