From my Trusty book of notes.
Acquiring JRE/JDK
First we need to download JDK and JRE 6 for CentOS. Download the following files to your root directory (~) with 'wget'. Note that you may need to change the file names as they may have some URL variables added to the name. Be sure to not download the RPM files.
- JDK Download
- JRE Download
Installing
Now that we have the files downloaded we need to create an installation directory for Java.
sudo mkdir /usr/java cd /usr/java
Now we need to execute the installation for Java Development Kit (JDK). In our example we will use specific file names. Keep in mind that your file names may vary.
sudo sh ~/jdk-6u14-ea-bin-b03-linux-amd64-10_mar_2009.bin
Press space to advance through the license agreement and type 'yes' to accept. Press enter to finish the installation.
Now we need to install the Java Runtime Edition (JRE). In our example we will use specific file names. Keep in mind that your file names may vary.
sudo sh ~/jre-6u14-ea-bin-b03-linux-amd64-10_mar_2009.bin
Press space to advance through the license agreement and type 'yes' to accept.
Verify the installation by typing ls. You should see two directories: jdk1.6.0_14 and jre1.6.0_14. Keep in mind that your version numbers may differ slightly.
Installing Ant and Tomcat
Next we will need to download and extract Apache Ant. Ant is an installation utility used by several Apache products.
To download Apache Ant you will need to visit the following website to download the installation file:
http://ant.apache.org/bindownload.cgi
Scroll down the page and find the .tar.gz under Current Release of Ant. Copy the URL and use wget to download the file to the /usr/share directory. Your version number may differ.
cd /usr/share sudo wget http://mirror.olnevhost.net/pub/apache/ant/binaries/apache-ant-1.7.1-bin.tar.gz
Next we need to unpack that file so we can install it. Note that your version number may be different.
sudo tar -xzf apache-ant-1.7.1-bin.tar.gz