Installing Sun Java SE 6, Maven 2 and Tomcat 5.5 on Fedora GNU/Linux
For using most of the enterprise technologies based on Java, you generally need at least the following components installed and configured on your system:
Based on which Java based technology/framework you want to use, you may need to install further dependencies. Even though you may not need all the three components mentioned above to be able to work with all Java technologies, I found myself installing them way too many times when compared to any other Java component that I wanted a place to document the installation process of these three components specifically, if only to refer to this post from other Java tutorials in future.
Installing OpenJDK/Sun Java SE 6, Apache Maven 2 and Tomcat 5 on Fedora GNU/Linux
Installing Java SE 6
You can’t install Sun’s JDK directly from the Fedora repositories, you have the following two choices:
# yum install compat-libstdc++-33 compat-libstdc++-296
# cd ~ & chmod +x jdk-6u7-linux-i586.bin
# ./jdk-6u7-linux-i586.bin
# javac -version
javac 1.6.0_07
As a final step, add the following line to your profile file(e.g. .bash_profile) to set the JAVA_HOME environment variable to the path where you have installed Sun JDK:
export JAVA_HOME /opt/jre/jdk
Make JAVA_HOME point to OpenJDK installation path if you are using OpenJDK.
Installing Apache Maven2
Apache Maven 2 can be installed using yum command:
# mvn ––version
Maven version 2.0.4
# yum remove maven2
Installing Maven 2 on Fedora 9 using the yum package manager gave me the old 2.0.4 version, so I removed it and decided to install Maven manually. To manually download and extract Maven 2 archive on Fedora 9, follow these instructions:
# mv apache-maven-2.0.9-bin maven2
export PATH=$PATH:$HOME/maven2/bin
# mvn ––version
Maven version 2.0.9
Java version 1.5.0
Installing Tomcat 5 and Jetty
You can finally install tomcat and jetty servers using yum command:
The installation procedure on other GNU/Linux distributions should be on similar lines using their respective package managers and I will try to post the procedure for Ubuntu, Gentoo, openSuse and Mandriva distributions in the near future.
Testing the installation
To test the above installation, see my next post(to be published), “Hello, World” Java Web Application using Java SE 6 + Tomcat 5.5 + Maven 2.”
Your instructions are confusing to me. If you install the jdk-6u7-linux-i586.bin, then why would you
expect to see java version 1.5? Aren’t you installing java 6 update 7?