netty java开发文档_《Netty官方文档》设置开发环境
原文鏈接 譯者:dan ? QQ:903585177
請(qǐng)注意:這個(gè)指南并不是用戶指南,它是開發(fā) Netty 本身的指南,而不是使用Netty 開發(fā)其他程序的指南。
使用64位操作系統(tǒng)
必須使用64位操作系統(tǒng)
安裝必須的構(gòu)建工具
64位JDK8或者以上,Apache Maven 3.1.1或者以上,Git。如果你是Linux系統(tǒng),你不得不安裝下列包:
# 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結(jié)束命令
對(duì)于源代碼,我們使用本地命令行結(jié)束(i.e. ‘\n’ for *nix and MacOS X, ‘\r\n’ for Windows.),為了防止你構(gòu)建失敗,請(qǐng)配置你的Git,如果你提交了錯(cuò)誤的文件,請(qǐng)遵守一下指示:
Dealing with line endingsby Github
Mind the End of Your Lineby Tim Clem, for more information
使用IntelliJ IDEA
Netty 項(xiàng)目項(xiàng)目組使用IntelliJ IDEA作為主要的IDE,但是我們也可以根據(jù)自已的編碼習(xí)慣使用不同的開發(fā)環(huán)境
版本位數(shù)與你的系統(tǒng)一致
如果你是要64位操作系統(tǒng),使用IntelliJ IDEA 64位版本,比如,即使您使用的是64位Windows,啟動(dòng)菜單快捷方式也會(huì)指向32位二進(jìn)制文件。 您必須在安裝目錄中找到idea64.exe,并使用它。 否則,你會(huì)看到IntelliJ IDEA抱怨它找不到io.netty:netty-tcnative:windows-x86_32。
編碼風(fēng)格
下載此代碼樣式配置,并將Netty project.xml解壓縮到 / codestyles目錄中。 選擇“Netty項(xiàng)目”作為默認(rèn)代碼樣式
檢驗(yàn)文件
下載,解壓并且導(dǎo)入這個(gè)檢驗(yàn)文件到你的IntelliJ IDEA,并將它設(shè)為默認(rèn),參照下面學(xué)會(huì)如何導(dǎo)入一個(gè)檢驗(yàn)文件。
確保您的修改不會(huì)引入任何檢查警告。 如果您認(rèn)為這是一個(gè)假陽性,請(qǐng)?jiān)贗DE引導(dǎo)下使用@SuppressWarnings注釋或noinspection行注釋來抑制警告。 有關(guān)使用檢查器的更多信息,請(qǐng)參閱Web幫助頁面。
版權(quán)文件
版權(quán)文件:
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.
在評(píng)論中檢測(cè)版權(quán)的關(guān)鍵字:
The Netty project licenses
如果舊版權(quán)包含以下內(nèi)容,請(qǐng)?jiān)试S替換版權(quán):
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不評(píng)估我們的pom.xml中指定的擴(kuò)展名的問題。 (與其名稱不同,它既是Maven插件又是Eclipse插件。)
3.導(dǎo)入項(xiàng)目方式:通過菜單’File → Import… → Existing Maven Projects’
4.Netty項(xiàng)目Maven pom.xml設(shè)置規(guī)定使用Java SE 1.6,同時(shí)隱式使用Java 7/8(1.7 / 1.8)功能(如果存在)。 這可能會(huì)導(dǎo)致Eclipse中的編譯錯(cuò)誤。 有兩種方法來解決這個(gè)問題:
5.尋找 ‘Window → Preferences → Installed JRE’ 菜單:
確保您在“Installed JRE”下安裝了Java 7/8安裝
將此Java 7/8安裝映射到Java 6:“Installed JRE→Execution Environments”→“Java SE 1.6”或者,可以為每個(gè)Netty模塊在每個(gè)項(xiàng)目的基礎(chǔ)上選擇Java 7/8 JRE。
總結(jié)
以上是生活随笔為你收集整理的netty java开发文档_《Netty官方文档》设置开发环境的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 三星ddr3内存:市场霸主的秘密揭秘
- 下一篇: java写 IP十进制转变_java实现