netty java开发文档_《Netty官方文档》设置开发环境
原文鏈接 譯者:dan ? QQ:903585177
請注意:這個指南并不是用戶指南,它是開發 Netty 本身的指南,而不是使用Netty 開發其他程序的指南。
使用64位操作系統
必須使用64位操作系統
安裝必須的構建工具
64位JDK8或者以上,Apache Maven 3.1.1或者以上,Git。如果你是Linux系統,你不得不安裝下列包:
# yum install lsb-core autoconf automake libtool make tar \
glibc-devel libaio-devel openssl-devel apr-devel \
lksctp-tools
# apt-get install autoconf automake libtool make tar \
libaio-dev libssl-dev libapr1-dev \
lksctp-tools
配置Git結束命令
對于源代碼,我們使用本地命令行結束(i.e. ‘\n’ for *nix and MacOS X, ‘\r\n’ for Windows.),為了防止你構建失敗,請配置你的Git,如果你提交了錯誤的文件,請遵守一下指示:
Dealing with line endingsby Github
Mind the End of Your Lineby Tim Clem, for more information
使用IntelliJ IDEA
Netty 項目項目組使用IntelliJ IDEA作為主要的IDE,但是我們也可以根據自已的編碼習慣使用不同的開發環境
版本位數與你的系統一致
如果你是要64位操作系統,使用IntelliJ IDEA 64位版本,比如,即使您使用的是64位Windows,啟動菜單快捷方式也會指向32位二進制文件。 您必須在安裝目錄中找到idea64.exe,并使用它。 否則,你會看到IntelliJ IDEA抱怨它找不到io.netty:netty-tcnative:windows-x86_32。
編碼風格
下載此代碼樣式配置,并將Netty project.xml解壓縮到 / codestyles目錄中。 選擇“Netty項目”作為默認代碼樣式
檢驗文件
下載,解壓并且導入這個檢驗文件到你的IntelliJ IDEA,并將它設為默認,參照下面學會如何導入一個檢驗文件。
確保您的修改不會引入任何檢查警告。 如果您認為這是一個假陽性,請在IDE引導下使用@SuppressWarnings注釋或noinspection行注釋來抑制警告。 有關使用檢查器的更多信息,請參閱Web幫助頁面。
版權文件
版權文件:
Copyright $today.year The Netty ProjectThe Netty Project licenses this file to you under the Apache License,
version 2.0 (the “License”); you may not use this file except in compliance
with the License. You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
在評論中檢測版權的關鍵字:
The Netty project licenses
如果舊版權包含以下內容,請允許替換版權:
The Netty project licenses
使用Eclipse 以及 M2E 和 Java 7/8
1.確保使用64位版本Eclipse
2.下載os-maven-plugin并將其放入 / plugins(Eclipse 4.5)或 / dropins(Eclipse 4.6)目錄中,以解決m2e不評估我們的pom.xml中指定的擴展名的問題。 (與其名稱不同,它既是Maven插件又是Eclipse插件。)
3.導入項目方式:通過菜單’File → Import… → Existing Maven Projects’
4.Netty項目Maven pom.xml設置規定使用Java SE 1.6,同時隱式使用Java 7/8(1.7 / 1.8)功能(如果存在)。 這可能會導致Eclipse中的編譯錯誤。 有兩種方法來解決這個問題:
5.尋找 ‘Window → Preferences → Installed JRE’ 菜單:
確保您在“Installed JRE”下安裝了Java 7/8安裝
將此Java 7/8安裝映射到Java 6:“Installed JRE→Execution Environments”→“Java SE 1.6”或者,可以為每個Netty模塊在每個項目的基礎上選擇Java 7/8 JRE。
總結
以上是生活随笔為你收集整理的netty java开发文档_《Netty官方文档》设置开发环境的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 三星ddr3内存:市场霸主的秘密揭秘
- 下一篇: java写 IP十进制转变_java实现