---
title: 编译安装
description: "1. 下载APR源码。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengbds/ecosystemEnable/tpdl/kunpengnettytcnative1133_02_0004.html
sourcePath: /source/zh/kunpengbds/ecosystemEnable/tpdl/kunpengnettytcnative1133_02_0004.html
indexId: 3a283ae2e560b82f8d37f83d700c444a09bbf4349f0a534b717d03d66a705dd680
---
# 编译安装

#### 安装APR

1. 下载APR源码。
  1 wget https://archive.apache.org/dist/apr/apr-1.5.2.tar.gz

2. 解压APR源码。
  1 tar -xvzf apr-1.5.2.tar.gz

3. 进入APR源码解压后的目录。
  1 cd apr-1.5.2

4. “/usr/local/apr”目录。
  1 2 ./configure --prefix=/usr/local/apr make && make install


#### 编译安装netty-tcnative-1.1.33.Fork19.jar

1. 下载netty-tcnative-1.1.33.Fork19.zip源码并解压。
  1 2 wget https://github.com/netty/netty-tcnative/archive/netty-tcnative-1.1.33.Fork19.zip unzip netty-tcnative-1.1.33.Fork19.zip

2. 修改pom.xml中下载apr-1.5.2.tar.gz链接，避免出现访问超时的问题。
  1 2 cd netty-tcnative-netty-tcnative-1.1.33.Fork19 vi pom.xml

  修改内容的位置有两处，如下：

  http://www.us.apache.org替换为https://archive.apache.org。

3. 下载openssl-1.0.2h，放置于“netty-tcnative-netty-tcnative-1.1.33.Fork19/openssl-static/target”。
  1 2 3 wget https://ftp.openssl.org/source/old/1.0.2/openssl-1.0.2h.tar.gz mkdir -p netty-tcnative-netty-tcnative-1.1.33.Fork19/openssl-static/target mv openssl-1.0.2h.tar.gz netty-tcnative-netty-tcnative-1.1.33.Fork19/openssl-static/target

4. 注释pom.xml中boringssl-static模块编译部分。
  1 vi netty-tcnative-netty-tcnative-1.1.33.Fork19/pom.xml

5. 编译安装netty-tcnative-1.1.33.Fork19.jar到本地maven库。
  1 mvn install -DskipTests

  编译目标netty-tcnative-1.1.33.Fork19.jar在目录“openssl-dynamic/target/”下。
