---
title: netty-all-4.1.3
description: "1. 下载APR源码。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengbds/ecosystemEnable/tpdl/kunpengnettyall4117_02_0012.html
sourcePath: /source/zh/kunpengbds/ecosystemEnable/tpdl/kunpengnettyall4117_02_0012.html
indexId: 3f191420604d7c98326ec3018e2f28da3e59bc86ef2ceddc96efb968e0de66da75
---
# netty-all-4.1.3

#### 安装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. 将APR指定安装到“/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链接，避免出现访问超时的问题。

  a. 进入netty-tcnative-netty-tcnative-1.1.33.Fork19目录，打开文件。
    1 2 cd netty-tcnative-netty-tcnative-1.1.33.Fork19 vi pom.xml

  b. 按“i”进入编辑模式，修改内容的位置有两处，如下图所示。
    http://www.us.apache.org替换为https://archive.apache.org。

  c. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
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模块编译部分。

  a. 打开文件。
    1 vi netty-tcnative-netty-tcnative-1.1.33.Fork19/pom.xml

  b. 按“i”进入编辑模式，如下图所示，注释<module>boringssl-static</module>内容。
  c. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
5. 编译安装netty-tcnative-1.1.33.Fork19.jar到本地Maven库。
  1 mvn install -DskipTests

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


#### 编译netty-all-4.1.3.Final.jar

1. 下载源码并解压。
  1 2 wget https://github.com/netty/netty/archive/netty-4.1.3.Final.tar.gz tar -zxvf netty-4.1.3.Final.tar.gz

2. 修改pom.xml文件。

  a. 打开文件。
    1 vi netty-netty-4.1.3.Final/pom.xml

  b. 按“i”进入编辑模式，注释如下内容。

    1. 注释含有fedora的内容。
    2. 注释x86_64版本指定JDK的内容。
  c. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
3. 编译netty-all-4.1.3.Final.jar。
  1 2 cd netty-netty-4.1.3.Final mvn package -DskipTests

  编译好的netty-all-4.1.3.Final.jar包，可在目录“netty-netty-4.1.3.Final/all/target”查看。

4. 使用鲲鹏应用迁移工具扫描编译生成的JAR包，确保没有包含有x86的so和JAR包。
  编译好的netty-all.4.1.3.Final.jar包一定要使用鲲鹏应用迁移工具扫描，确保没有包含x86的so和JAR包。如果不进行扫描，可能会遗漏x86的so文件和JAR包，导致这些文件未被及时处理，从而对组件的后续功能使用产生负面影响。 关于如何使用鲲鹏应用迁移工具进行扫描的详细信息，请参见《使用鲲鹏应用迁移工具案例(https://www.hikunpeng.com/document/detail/zh/kunpengbds/ecosystemEnable/porting-tuning-devkit/kunpengprtguseda_01_0004.html)》。
