嗨伙计们尝试在tomcat上使用eclipse/linux运行我的应用程序时,我收到以下信息消息:
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64/server:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.20/jre/../lib/amd64:/usr/lib64/xulrunner-addons:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
如何解决这个问题?
我的情况:看到相同的INFO消息.
Centos 6.2 x86_64 Tomcat 6.0.24
这解决了我的问题:
yum install tomcat-native
繁荣!
1. Install compilers #sudo apt-get install make #sudo apt-get install gcc 2. Install openssl and development libraries #sudo apt-get install openssl #sudo apt-get install libssl-dev 3. Install the APR package (Downloaded from http://apr.apache.org/) #tar -xzf apr-1.4.6.tar.gz #cd apr-1.4.6/ #sudo ./configure #sudo make #sudo make install You should see the compiled file as /usr/local/apr/lib/libapr-1.a 4. Download, compile and install Tomcat Native sourse package tomcat-native-1.1.27-src.tar.gz Extract the archive into some folder #tar -xzf tomcat-native-1.1.27-src.tar.gz #cd tomcat-native-1.1.27-src/jni/native #JAVA_HOME=/usr/lib/jvm/jdk1.7.0_21/ #sudo ./configure --with-apr=/usr/local/apr --with-java-home=$JAVA_HOME #sudo make #sudo make install Now I have compiled Tomcat Native library in /usr/local/apr/libtcnative-1.so.0.1.27 and symbolic link file /usr/local/apr/@libtcnative-1.so pointed to the library 5. Create or edit the $CATALINA_HOME/bin/setenv.sh file with following lines : export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/usr/local/apr/lib' 6. Restart tomcat and see the desired result: