NOTE: Thanks to Ben Chapman for updating the previous version of the instructions. This document mirrored from http://www.law.emory.edu/~bchapman/tomcat5.html with modifications to the style, formatting and attribution.

These instructions help you install Sun's Java 1.5.0.11-1 JDK on Centos 4.4, so that you can run tomcat 5.

First, you'll need some base packages that you may not have already installed.

   yum install rpm-build gcc-java

Visit the jpackage.org site and navigate to their yum page (https://jpackage.org/yum.php)

Copy this file ( https://jpackage.org/jpackage.repo ) into /etc/yum.repos.d/

The repo file does not have the jpackage repositories enabled by default. You'll need to set enabled=1 for each repo that you need.

   yum update

Get some SRPMs for building the non-free packages. I like installing these to /usr/local/src on Linux systems. If you prefer another directory (/tmp works well) use it instead.

   cd /usr/local/src
   wget ftp://jpackage.hmdc.harvard.edu/mirrors/JPackage/1.7/generic/non-free/SRPMS/java-1.5.0-sun-1.5.0.11-1jpp.nosrc.rpm
   wget ftp://jpackage.hmdc.harvard.edu/mirrors/JPackage/1.6/generic/non-free/SRPMS/jta-1.0.1-0.b.4jpp.nosrc.rpm

Download some required files to /usr/src/redhat/SOURCES:

   cd /usr/src/redhat/SOURCES

Download jta-1_0_1B-classes.zip here after agreeing to the license. Look for the link to "Class Files 1.0.1B"

Download jdk-1_5_0_11-linux-i586.bin, again after agreeing to a license. The Sun page is somewhat confusing to navigate. You can start here and navigate through the series of clicks until you get to the following screen.

   Image of downloadable J2 SDK

This page was last updated on 2006-03-07. You might have to poke around on the to find the right files if Sun has changed those pages too much.

Build and install the non-free packages.

   rpmbuild --rebuild /usr/local/src/java-1.5.0-sun-1.5.0.11-1jpp.nosrc.rpm
   rpm -ivh /usr/src/redhat/RPMS/i586/java-1.5.0-sun-1.5.0-11-1jpp.i586.rpm
   rpm -ivh /usr/src/redhat/RPMS/i586/java-1.5.0-sun-devel-1.5.0.11-1jpp.i586.rpm
   rpmbuild --rebuild --without javadoc /usr/local/src/jta-1.0.1-0.b.4jpp.nosrc.rpm
   rpm -ivh /usr/src/redhat/RPMS/noarch/jta-1.0.1-0.b.4jpp.noarch.rpm

And finally, install the free packages (do not panic - this will cause lots of packages to be installed):

   yum install tomcat5 tomcat5-webapps tomcat5-admin-webapps

Troubleshooting

  • If the rpmbuild --rebuild step complains about missing sources, it's because you didn't copy the jta and jdk binary files into the /usr/src/redhat/SOURCES directory.
  • If the system can't find rpmbuild, it's because you didn't install rpm-build.
  • Watch the console when you start up tomcat with "/sbin/service tomcat5 start" . If it complains about missing jar files, you may need to fetch those with a "yum install <name-of-missing-package>" before your tomcat will run correctly.
  • I do not know if there is some subtle incompatibility created by installing the JDK from the 1.7 JPackage repo, while the jta is pulled from the 1.6 JPackage repo. So far, this seems to work. There is no jta in the 1.7 repo.
  • If you previously tried other methods to install the jdk, tomcat, etc., you should make sure that you've uninstalled those RPMs or files before following these instructions. Otherwise, rpm will complain.
  • If you're running something like Bastille on your Centos box, make sure that your configuration allows connections to port 8080.

'Business' 카테고리의 다른 글

Oil falls below $59, gasoline continues plunge  (0) 2008.11.12
Consumer spending worries clobber stocks  (0) 2008.11.12
Silicon Lining  (0) 2008.11.12
Oil falls to $60 as China spending optimism wanes  (1) 2008.11.12
Global Financial Crisis  (1) 2008.11.12
Posted by CEOinIRVINE
l