APR based Apache Tomcat Native library was not found on the java.library.path?

后端 未结 4 1514
时光说笑
时光说笑 2020-12-05 07:47

When trying to run my app with eclipse/linux on tomcat I got the following info message:

INFO: The APR based Apache Tomcat Native library which allows optima         


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-05 08:15

    For Ubntu Users

     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:
    

提交回复
热议问题