OSX: The Apache Tomcat Native library... was not found on the java.library.path
Submitted by Matt Fleming on Mon, 2008-02-18 15:08.
Here's how to get rid of the log message-- INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path when you startup Tomcat on OSX. On Windows, all one needs to do is drop in a precompiled dll, on OSX there are a few more steps...
Overview
- Build and install OpenSSL
- Build and install Apache Portable Runtime (APR)
- Build and install Tomcat Native Wrapper
OpenSSL
- Download the latest tarball (version at the time of this writing, openssl-0.9.8g)
- Extract source (geshifilter-codetar zxvf openssl-0.9.8g.tar.gz/geshifilter-code)
- Compile and install:
cd openssl-0.9.8g ./config make sudo make install
APR
- Download the latest tarball (version at the time of this writing, apr-1.2.12)
- Extract source (geshifilter-codetar zxvf apr-1.2.12.tar.gz/geshifilter-code)
- Compile and install:
cd apr-1.2.12 ./configure make sudo make install
Tomcat Native Wrapper
- Use the version in $CATALINA_HOME/bin/tomcat-native.tar.gz OR download the latest tarball (version at the time of this writing, tomcat-native-1.1.13
- Extract source (geshifilter-codetar zxvf tomcat-native.tar.gz/geshifilter-code or geshifilter-codetar zxvf tomcat-native-1.1.13-src.tar.gz/geshifilter-code)
- Compile and install:
./configure --with-apr=/usr/local/apr --with-java-home=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home --libdir=/usr/lib/java --prefix=/usr/lib/java --with-ssl=/usr/local/ssl make sudo make install cd /usr/lib/java sudo ln -s libtcnative-1.dylib libtcnative-1.jnilib
End Result
If you did everything correctly, the original info message should go away and you should see something like this in the log:
Feb 18, 2008 2:14:56 PM org.apache.coyote.http11.Http11AprProtocol init INFO: Initializing Coyote HTTP/1.1 on http-8080
In addition to the performance benefits, you also get a couple of more features from tomcat:
- Secure session ID generation by default on all platforms
- OS level statistics on memory and CPU usage are displayed by the status servlet (in the manager app)
