EV: eclipse 使用技巧
1. Shortcusts
alt+shift+up/dw: select/deselect element
alt+shift+lf/rt: select previous/next element
ctrl+shift+p: match brackets
ctrl+shift+y/x: lower/upper case
ctrl+shift+up/dw: previous/next element
ctrl+shift+w: close all windows
ctrl+shift+f: format codes
ctrl+alt+up/dw: copy selected lines into above/below
Alt+Enter: Properties window of current file
ctrl+F11: Run
Alt + Shift + a: vertical/column edit mode
CTRL+3: Quick Access
2. Build error caused by invalid reference path.
1. Right click the package in Package Explore.
2. Select "Build Path-->Configure Build Path..." from the context menu.
3. Select "Java Build Path" node from the left node list.
4. Make sure paths under Libraries tab are all correct. If not, fix it.
3. File Search Error: xxx file skipped.
Cause: The xxx file was removed from its original location while the workspace is closed in Eclipse.
Resolution: Open the workspace in Eclipse, then add any file to workspace, then remove it. Restart eclipse. The search error will not occur.
4. Show/open current/selected file in windows explorer.
1. Select current file from Package Explorer (Link with Editor can be used).
2. In the context menu, select Show In>System Explorer.
Or
1. Run->External Tools->External Tools Configurations
2. Select Program node from the tree view at left of the window.
3. Add a new configuration:
Name: Explorer
Location: C:\Windows\explorer.exe
Arguments: /Select,"${resource_loc}"
To launch it quickly, you can also assign a shortcut for "Run Last Launched External Tool".
1. Window->Preferences->General->Keys
2. Enter "Run Last Launched External Tool" in "type filter text" textbox
3. Binding a shortcut, e.g., Shit+F2
5. Copy path/directory of current/selected file.
1). Select current file from Package Explorer (Link with Editor can be used). Shortcut: Alt+Enter
2). In the context menu, select Properties>Resource>Location. Then, you can copy the full path in Location field.
6. Open Java Build Path dialog
Method#1: Right click project in Package Explorer or Project Explorer -> Build Path -> Configure Build Path...
Method#2: In a file editor window of the project, Project (menu) -> Properties -> Java Build Path
7. Library Reference
If a project depends on other projects. Those projects should be added in the build path of current project.
There are two ways to refer a project.
Method#1:
1). Open Java Build Path dialog
2). Switch to Libraries tab
3). [Add External JARs...]
Method#2:
0). Import the referred project into current workspace
1). Open Java Build Path dialog
2). Switch to Projects tab
3). [Add...]
Comments:
In method#1, you cannot debug into codes of referred projects if JARs are referred.
In method#2, you can.