Mac 下 Netty 4.1 代码编译与运行
一、基本环境
1、本地环境
- JDK 1.8,64位
➜ ~ java -version
java version “1.8.0_271”
Java™ SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot™ 64-Bit Server VM (build 25.271-b09, mixed mode)
- IDEA 64位
查看版本
版本信息
- Mac 操作系统
dasd
- Maven 环境
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00)
Maven home: /xx/apache-maven-3.5.4
Java version: 1.8.0_271, vendor: Oracle Corporation, runtime: /xx/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: “mac os x”, version: “10.16”, arch: “x86_64”, family: "Mac
环境参考:https://github.com/netty/netty/wiki/Setting-up-development-environment
源码下载地址:https://github.com/netty/netty
二、编译
运行编译命令:
mvn install -Dmaven.test.skip=true -Dcheckstyle.skip=true
查看具体出错的位置:
mvn -U -X clean package
1、结果
netty 编译结果
2、核心包
netty 中的包,主要可以分为下面三个部分
- Transport
- TCP/UDP:对于TCP而言,它可能有不同的native实现,如:epoll(Linux)、kqueue(Mac)、common(Unix)
- SCTP
- Protocol
- 编解码:粘包、半包、协议支持
- handler
- 工具类
- buffer
- common
- resolver
3、常见问题
- Requested download does not exist
[ERROR] Failed to execute goal org.fusesource.hawtjni:maven-hawtjni-plugin:1.14:build (build-native-lib) on project netty-transport-native-kqueue: build failed: org.apache.maven.plugin.MojoExecutionException: Requested download does not exist.: Could not find artifact io.netty:netty-transport-native-kqueue:zip:native-src:4.1.64.Final-SNAPSHOT in sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots)
解决方法:
brew install autoconf automake libtool
- Could not find artifact io.netty:netty-tcnative:jar:xxxxxx in central
解决方法:手动执行 tcnative.classifier 版本(如:windows),不依靠netty的自动检测
<!--<tcnative.classifier>${os.detected.classifier}</tcnative.classifier>
-->
<tcnative.classifier>windows-x86_64</tcnative.classifier>
- Error:(18,31) java: 错误: 程序包io.netty.util.collection不存在
解决方法:单独编译一下 netty-common 模块
linux 下 可以使用 mvn compile -Dcheckstyle.skip=true -e 生成 io.netty.util.collection
- check-style
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] .........
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.12.1:check (check-style) on project netty-common: Failed during checkstyle execution: There are 314 checkstyle errors. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionExceptionProcess finished with exit code 1
原因:git将会根据使用者的系统自动将下载项目中的换行符转换成系统的换行符,如果使用 Download Zip 方式下载项目的话会遇到这类问题。
解决方法: 使用 Git clone 命令下载源码
Mac 下 Netty 4.1 代码编译与运行相关推荐
- 初步了解mac下C源码的编译过程
初步了解mac下C源码的编译过程 参考: 请问Mac OS X (10.9.1)下创建和使用动态链接库的方法 cc.gcc.g++.CC的区别概括 - 今晚打酱油_ - 博客园 Linux 下 的 c ...
- Ubuntu16下bitcoin源码的编译与运行-2021
Ubuntu16下bitcoin源码的编译与运行 1.更新软件列表 2.安装依赖包 3.将源代码克隆到本地 4.编译运行 5.回到./bitcoin目录下重新编译 6.编写配置文件 7.bitcoin ...
- MAC下 抖音APK反编译
在mac下对抖音APK进行反编译,一次简单的案例.希望会对大家有所帮助. dex2jar 安装 我们下面的操作需要使用到 mac上Android反编译工具dex2jar 已经安装过的可以直接前往下方查 ...
- 随想录(mac下c、c++的编译方法)
[ 声明:版权所有,欢迎转载,请勿用于商业用途. 联系信箱:feixiaoxing @163.com] 以前在mac上面开发程序,我一直以为开发程序都需要安装xcode软件,但是事实上并非如此.mac ...
- mac下hadoop 2.6.0编译native library
本文中的所有路径请根据个人情况修改. 编译好的native library见个人资源:[http://download.csdn.net/detail/tterminator/9565597] 一.为 ...
- mac下通过gcc命令手动编译动态链接库示例
编译动态链接库,windows,linux,mac平台各不相同,从文件上来说,windows下是dll,linux下是so,mac下是dylib:命令上也会有区别,windows下用cl,linux下 ...
- 如何在Windows下使用Linux系统来编译和运行程序?
很多开发人员都有这样的疑问:自己平时是在Windows下面办公的,而自己编写的程序的运行环境又是Linux的,如何从Windows切换到Linux呢?是不是要专门到Linux机器上去编写代码呢? 实际 ...
- Ubuntu14.04下C++程序编辑、编译、运行入门篇
初次接触Ubuntu,一脑子的糊涂,更别提如何在Ubuntu下编译运行C++程序了,经过查资料,下面是自己在Ubuntu下写的第一个C++程序,仅供初学者参考,也为自己的入门学习梳理下思路. 一.编译 ...
- X86_64(优麒麟)系统下构建 i386 文件系统并编译Box86运行wine
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言 一.在 X86_64 Linux 系统下搭建 i386 文件系统 二.配置 Schroot 工具使得文件系统切换更方便 ...
- M1芯片的mac下的Xcode12以上版本编译报错 this target. for architecture arm64等问题解决方案
最近换了 mac M1芯片 开发,xcode12在运行旧项目报错 的问题 xxxx building for iOS Simulator, but linking in object file bui ...
最新文章
- eclipse快捷键操作
- PHP无法编译undefined reference to `libiconv_open
- 集合框架源码分析五之LinkedHashMap,LinkedHashSet
- JavaScript那些事儿-不被知晓的预解释
- Alphabet旗下自动驾驶部门Waymo将在匹兹堡设立办公室
- 20-400-040-高可用-Flink集群的高可用搭建
- android eclipse不能创建activity,在eclipse里面开发android应用,不能新建Activity
- html5结构 客户端缓存,Javascript--离线应用与客户端储存
- php mysql select where_PHP MySQL Where 子句
- c语言顺序栈的基本操作
- 写给音响工程师的科普文章(一)——从模电角度去了解调音台的信号流程
- 【并联机构工作空间分析系列1】 多个圆/圆环求交 得到重叠部分边界 Matlab程序
- 使用nvim来代替VSCode,神操作
- C++ 栈实现逆波兰式求解运算式和两栈共享存储空间
- 计算机 管理 mmc 注册表,win10注册表编辑器没有mmc怎么办_win10恢复注册表mmc文件夹的方法-win7之家...
- 魔兽地图服务器修改,如何修改魔兽地图(傻瓜版)
- 常威来了(变量和常量)简单易懂
- 网络基础知识汇总学习
- 泾阳县副县长崔巍领导一行莅临秦储指导交流
- JQuery学习04篇(层次选择器)