一.安裝eclipse
1.windows
a.打開eclipse官網,選擇下載離線安裝包,其實就是已經打包好的程序,解壓出來就能運行。
b.根據系統版本選擇相應的下載文件
c.將下載好的壓縮文件解壓到C:\Program Files (x86)文件夾
d.雙擊eclipse.exe 即可運行eclipse
2.linux
a.下載步驟和windows一樣,但再選擇下載文件時將下載版本選爲linux
b.將下載的壓縮文件解壓至/opt 目錄下
c.給程序再開始菜單創建快捷方式
d.點擊開始菜單的eclipse快捷方式運行eclipse
二.調試
1.常用快捷鍵
代碼助手:Alt+/
快速修正:Ctrl+1
單詞補全:Alt+/
打開外部Java文檔:Shift+F2
顯示搜索對話框:Ctrl+H
快速Outline:Ctrl+O
打開資源:Ctrl+Shift+R
打開類型:Ctrl+Shift+T
顯示重構菜單:Alt+Shift+T
上一個/下一個光標的位置:Alt+Left/Right
上一個/下一個成員(成員對象或成員函數):Ctrl+Shift+Up/Down
選中閉合元素:Alt+Shift+Up/Down/Left/Right
刪除行:Ctrl+D
在當前行上插入一行:Ctrl+Shift+Enter
在當前行下插入一行: Shift+Enter
上下移動選中的行:Alt+Up/Down
組織導入:Ctrl+Shift+O
2.設置斷點單步調試
三.整型變量定義
class test {
public static void main(String[] args) {
// TODO 自動生成的方法存根
boolean a=true;
byte b=1;
char c=0x0097;
short d=127;
int e=65536;
long f=131072l;
float g=3.141592f;
double h=3.141592653589793d;
System.out.println("boolean ="+a);
System.out.println("byte ="+b);
System.out.println("char ="+c);
System.out.println("short ="+d);
System.out.println("int ="+e);
System.out.println("long ="+f);
System.out.println("float ="+g);
System.out.println("double ="+h);
}
}