Solution to tomcat apr warning in mac OS

Source: Internet
Author: User

This article introduces the tomcat apr warning solution for mac OS. For more information, see.

The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java. library. path :... tomcat can integrate local apr to accelerate processing of static resources. In short, the local apr library is used to improve processing efficiency. On the Internet, many people mentioned this problem. It is actually very simple to solve this problem, but Windows and linux have different processing methods. The solutions are given below.

Window Platform
When WINDOWS is started, was not found on the java. library. path: C: Toolsjdk1.6.0 _ 29bin; C: WINDOWSSunJavabin; C: WINDOWSsystem32; C: WINDOWS ..., Depending on the environment of each person, the paths may be different. Just copy the Native library to one of the above paths. What is the Native library? Download is available on the Internet, in fact, not so troublesome, in the bin directory of tomcat there is, the file name is: tcnative-1.dll. For example, if I copy this file to C: Toolsjdk1.6.0 _ 29bin, and then start tomcat, there will be no such prompt.

Linux platform
Linux is more complex, because the tomcat package does not provide compiled so files, so you need to compile your own, tomcat release provides the source code, the file is tomcat bin/tomcat-native.tar.gz, in addition, it depends on APR 1.2 and OpenSSL during compilation. If it is not installed on the machine, you can use yum-y install apr-devel openssl-devel for installation. Decompress tomcat-native.tar.gz To Get A tomcat-native-1.1.20-src directory, the Native library source file is located in the tomcat-native-1.1.20-src/jni/native, enter the directory, execute. /configure, you may see configure: error: APR cocould not be located. please use the-with-apr option. in this case, use-with-apr to specify the location of the apr.

. /Configure -- with-apr =/usr/bin/apr-1-config, pass, and then execute make & make install to compile, at this point you should be able to see a file named libtcnative-1.so under/usr/local/apr/lib/, copy the file to any path prompted at tomcat startup.

Another method

The preceding section describes how to solve this problem in Windows and linux. Recently, mac OS has encountered the same problem. The solution is similar to that in linux. The only difference is that you need to specify the java home


The first condition for self-compilation is that gcc has been installed. For details about how to install gcc, refer to installing gcc on mac OS lion. The dependent libraries appear to be built-in by default, if the library is missing during compilation, you can install it using the port method. By the way, port is a package management software similar to yum in centos and apt-get In ubuntu. The configure parameter I used is set as follows:

. /Configure -- with-apr =/usr/bin/apr-1-config -- with-java-home =/System/Library/Frameworks/JavaVM. framework/-- with-OS-type = Headers/and then use make and make install to compile. If successful, a library file named libtcnative-1.0.dylib is generated under the directory/usr/local/apr/lib, use the ln command to make a soft link to a directory mentioned in the preceding warning information, for example:

Ln-s/usr/local/apr/lib/libtcnative-1.dylib/Library/Java/Extensions/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.