Eclipse Tips

Version: Indigo, Neon

啟動Eclipse出現

Java was started but returned error code=13

JDK版本與Eclipse不一致 (32位元與64位元混用), 需一同為32位元 or 64位元

好用的 Plug-in

Findbugs Plug-in: Code Analyser (JDK 7 above)

Eclipse Class Decompiler

PropertiesEditor

啟動Eclipse指定 JVM 版本

預設啟動Eclipse會使用 %JAVA_HOME% 所設定的版本

Method 1:

修改 eclipse.ini, 加上-vm參數

  • 不可寫在同一行
  • 必需加在-vmargs之前
  • Eclipse 與 JVM 必需是同位元 (32-bit or 64-bit), 不可混用
-vm
C:/Java/JDK/1.8/bin/javaw.exe

Method 2:

建立 eclipse.exe 捷徑→內容→目標加上-vm參數。啟動 Eclipse 時透過捷徑啟動。

...eclipse.exe -vm C:/Java/JDK/1.8/bin/javaw.exe

Workbench 指定預設Workspace

(Eclipse Online Help → Workbench User Guide → Tasks → Running Eclipse)

1. 建立Eclipse捷徑

2. 內容 → 目標, 在eclipse.exe後面加上-data [workspace路徑]

例: c:\eclipse\eclipse.exe -data c:\MyWorkspace\workspace

Launch “Select a workspace”

1. 建立Eclipse捷徑

2. 內容 → 目標, 在eclipse.exe -clean

(windows→Preferences→General→Startup & Shutdown→Workspaces→Prompt for workspace on startup 似乎無作用?)

Hot Key

To Upper Case : Ctrl+Shift+X

To Lower Case : Ctrl+Shift+Y

Import : Ctrl+Shift+O

Format : Ctrl+Shift+F

Toggle Comment : Ctrl+/

Quick Fix : Ctrl+1

Go to Line : Ctrl+L

Delete Line : Ctrl+D

System.out.println : sysout+Alt+/ (based on the setting in General→Keys→Content Assist)

Set Default Editor

Window→Preferences→General→Editors→File Associations→Select [File Type]→Add/Select Associated editors→Set Default

建立 Maven Project 時出現 Could not calculate build plan…的錯誤

主要原因是相關的 library 不存在, 且目前的電腦是offline的狀態, 無法下載 library, 因此出現此錯誤。

連上網, 執行Run As→Maven install & Maven→Update Project 即可

Reference

http://help.eclipse.org/indigo/index.jsp

https://wiki.eclipse.org/Eclipse.ini

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s