[CentOS] Java install

Thu Sep 11 17:09:54 UTC 2008
nate <centos at linuxpowered.net>

Ric Moore wrote:

> Whew. Getting jetty and java all classpath straight and working together
> has been a pain. Everything I've read and googled says I done the proper
> steps, so it's something I'm not getting right on my end, and to ask the
> list to figure it out would be too huge a chore to ask of anyone. I'll
> figure it out. The usual fix is just to start over, with the docs at
> hand. <grins> Persistence counts in Linux! Do you recommend I uninstall
> all rpm's for java/jetty at the same time?? I know some things are going
> to squeak about it.

Depends on your requirements, but for my systems, I make sure all
of the distribution specific rpms around java are removed(I use
cfengine, so package state is checked hourly and they are removed
automatically), install the jdk/jre that you want to use from Sun,
and then what I do is update the PATH to include /usr/java/<jdk rev>/bin
and set the JAVA_HOME in /etc/bashrc

##### BEGIN Java Home Config CFEngine dc1-hpsim001 Rev 3
export JRE_HOME="/usr/java/jdk1.5.0_11/jre"
export JAVA_HOME="/usr/java/jdk1.5.0_11"
export PATH="$JAVA_HOME/bin:$PATH"
##### END Java Home Config CFEngine dc1-hpsim001 Rev 3

That too is controlled by cfengine in the event of upgrades etc.
The Sun Java RPM package is also installed for me by cfengine as
well, so I don't have to do much to enable java on a system, in
most cases it automatically installs itself if the host name
falls into certain naming schemes defined by regular expressions.

nate