創建maven的hadoop項目的步驟及eclipse 的java快捷鍵

1、打開eclipse
2、選擇File–>New–>other

3、
在這裏插入圖片描述在這裏插入圖片描述

4、
在這裏插入圖片描述

5、添加依賴
打開pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>crg.hadoop</groupId>
	<artifactId>mapreduce</artifactId>
	<version>0.0.1-SNAPSHOT</version>

	<dependencies>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-client</artifactId>
			<version>2.6.1</version>    
		</dependency>
	</dependencies>
</project>

之後右擊鼠標,選擇Run as–>Maven build,自動生成對應版本的包(下載2.6.1版本的jar包)

maven打jar包
右擊項目,選擇run as -->maven bulid (maven install)。打完jar包在target裏

java快捷鍵
1、關於自動生成對象的類型的快捷鍵,自己設置的
在這裏插入圖片描述
2、要修改名字,也使得整體改變,雙擊待重命名的名字,然後按shift+alt+R
3、在這裏插入圖片描述
4、補全代碼alt+/
5、main+Alt+/用於補全main方法,syso+Alt+/用於補全System.out.println()打印輸出代碼
6、Ctrl+/ 用於單行註釋,去掉單行註釋的快捷鍵是同樣的。 選中要註釋的代碼鍵入Ctrl+Shift+/可用於多行註釋,光標在區域內鍵入Ctrl+Shift+\用於取消註釋。
7、右擊 Java 編輯器窗口內空白處,在彈出的菜單中的 Source > Override & Implements 就是這個功能,如果有快捷鍵會同時出現在這個菜單上的。
8、強轉類型:雙擊類,ctrl+t

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章