---
title: "tcnative-1.dll"
author: "chokee"
date: "2014-01-02T16:18:17Z"
tags: []
categories: ["开源软件"]
slug: "tcnative-1-dll"
draft: false
lastmod: "2014-01-02T16:18:17Z"
id: 1998379
url: "https://chokee.iteye.com/blog/1998379"
---

今天在Eclipse上配置Tomcat7，启动时看到如下警告信息：
The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path 
    感到很不舒服，于是在网上找了些解决办法。
 
    以下内容来自：http://cooliron.blog.163.com/blog/static/124703138201112211571276/
 
    在eclipse中，启动tomcat时会出现如此信息：The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path，它其实不影响程序的正常运行，但看到了，感觉实在别扭。其解决办法如下：
http://archive.apache.org/dist/tomcat/tomcat-connectors/native
下载tcnative-1.dll，然后放到你的JDK路径下的bin目录下。重新启动tomcat，就没有问题了。
    这个tcnative-1.dll 他的作用如下：
    tomcat整合本地apr会使效率提升：
    一是，处理静态资源的时候速度更快，（注：有人用jmeter，对使用apr前后的tomcat进行压力测试，结果显示，性能是有一定的提升，但是没有想象中多，只有一点点，当然，这与运行的逻辑有关，但是我个人认为在大多数情况下这部分性能提升甚微）。
    二是，我认为提升比较多的是对ssl的处理效率，当tomcat处理https的请求是，如果使用本地的openssl库，肯定会比前面提升的效率高。（虽然没有实际测试数据，但我推测这里的性能提升比例上要比第一点多得多）。
 
    原因上面已经说得很清楚了，下面说下我的解决办法。
    首先，tcnative-1.dll不需要下载，至少对于Tomcat7来说是这样，我们可以在其bin目录下找到这个dll；
    其次，tcnative-1.dll放在哪儿不要紧，只要在系统的PATH中可以找到就行。
 
   解决：
   在系统的环境变量中添加CATALINA_HOME，它指向你的Tomcat根目录，接着在PATH路径中添加%CATALINA_HOME%\bin;
   这样就可以解决了，对了，设置完成后，可能需要重启下Eclipse。