Install java 7, tomcat, etc. on CentOS

Hi,

I would like to install Sun JDK 7, tomcat, ant, etc. on CentOS 5.5. Could anyone provide some instructions?

Thanks
wsyyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jayachandran PalanisamyTechnical Consultant - LinuxCommented:
Hi,

I hope following steps could help you.

Install JAVA:
yum install java-(version)

Open in new window

where (version) must be a valid version of the JDK.
http://openjdk.java.net/install/index.html
(OR)
cd /usr/local/src
wget http://download.oracle.com/otn-pub/java/jdk/7u2-b13/jdk-7u2-linux-x64.rpm

Open in new window

(If your OS is 64bit)
wget http://download.oracle.com/otn-pub/java/jdk/7u2-b13/jdk-7u2-linux-i586.rpm

Open in new window

(If you are running on 32bit)
rpm -ivh jdk-7u2-linux-x64.rpm

Open in new window

Note:  Read this doc to install Java.
http://docs.oracle.com/javase/7/docs/webnotes/install/linux/linux-jdk.html

To Install Ant:
wget http://apache.osuosl.org//ant/binaries/apache-ant-1.8.2-bin.tar.gz
To install check this URL.
http://ant.apache.org/manual/install.html#getBinary


Install Tomcat 7.x.x:
cd /usr/local/
wget http://apache.cc.uoc.gr/tomcat/tomcat-7/v7.0.23/bin/apache-tomcat-7.0.23.tar.gz
tar -zxvf apache-tomcat-7.0.23.tar.gz
rm apache-tomcat-7.0.23.tar.gz
cd apache-tomcat-7.0.23/bin
./startup.sh

Open in new window

You can find the version to download from the binary distribution HERE.
http://tomcat.apache.org/download-70.cgi


Next you must install tomcat native by downloading the source from here:
http://tomcat.apache.org/download-native.cgi
cd ~
mkdir installers && cd installers
wget http://apache.cc.uoc.gr//tomcat/tomcat-connectors/native/1.1.22/source/tomcat-native-1.1.22-src.tar.gz
tar -zxvf tomcat-native-1.1.22-src.tar.gz
rm tomcat-native-1.1.22-src.tar.gz
cd tomcat-native-1.1.22-src/jni/native
./configure --with-apr=/usr/bin/apr-1-config --with-java-home=/usr/local/java-1.7.2
 
*java-1.7.2 - your Java SDK installed path
make
make install

Open in new window


Next open up the catalina.sh (where it is probably located at /usr/share/apache-tomcat-7.0.23/bin/catalina.sh) and put export LD_LIBRARY_PATH="/usr/local/apr/lib" at the start of the file.

-Jay
0
wsyyAuthor Commented:
Jay, thanks a bunch for providing so detailed info.

I wonder why I must install  tomcat native.
0
wsyyAuthor Commented:
Also,

*java-1.7.2 - your Java SDK installed path

I wonder if something is omitted here. The jdk path in my server is /opt/jdk

What should I will this "*java-1.7.2"?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

wsyyAuthor Commented:
[root@cld01-01 native]# ./configure --with-apr=/usr/bin/apr-1-config --with-java-home=/opt/jdk1.7.0_02
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
Tomcat Native Version: 1.1.22
checking for chosen layout... tcnative
checking for APR... configure: error: the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.


Jay, as u would see, the --with-apr parameter is incorrect. What is APR? How can I solve this?
0
wsyyAuthor Commented:
Jay, please forgone the above comments. I figured out to install apr by the following command:

 yum install apr-devel openssl-devel

Also, I have followed your suggestions to put the export LD_LIBRARY_PATH="/usr/local/apr/lib" the second line of the catalina.sh.

But I don't know why I should install the tomcat native and how to test if the native has been successfully installed.
0
Jayachandran PalanisamyTechnical Consultant - LinuxCommented:
0
wsyyAuthor Commented:
Jay,

I followed ur instructions. Now how can I test if tomcat native is there to work.
0
Jayachandran PalanisamyTechnical Consultant - LinuxCommented:
wsyy,

check the difference between various connectors.(Under "Which connector?" section)
http://www.springsource.com/files/uploads/tomcat/tomcatx-performance-tuning.pdf

APR/Native is the flexible one to use. If you  want to go others for specific reasons then you can proceed.

Jay
0
Jayachandran PalanisamyTechnical Consultant - LinuxCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.