Monday, August 13, 2012

How to install Apache Tomcat Native library on CentOS 5.5

If you see this in your tomcat log

INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:

Do so:

yum install apr-devel

Download package from

cd tomcat-native-1.1.20-src/jni/native/

You must have java installed (I use sun-java). Since you are using tomcat, it is already installed, isn't it?

./configure --with-apr=/usr/bin/apr-1-config

In any case you will get (I don't know, I've not investigated)

configure: error: can't locate a valid JDK location


./configure --with-apr=/usr/bin/apr-1-config --with-java-home=/usr/java/jdk1.6.0_24


su -

make install

At this point you must inform tomcat where this library is located

We can add
to JAVA_OPTS in the script

or add
export LD_LIBRARY_PATH="/usr/local/apr/lib"
at the begginning of the same script

1 comment:

  1. I made it with

    ./configure --with-apr=/usr/bin/apr-1-config --with-java-home=/usr/java/latest

    which is somewhat "version indipendent"