2015-12-02 14:23:39 +00:00
|
|
|
|
#+TITLE: Java layer
|
2015-07-04 04:55:38 +00:00
|
|
|
|
|
2015-07-04 05:44:50 +00:00
|
|
|
|
[[file:img/java.png]]
|
|
|
|
|
|
2016-03-31 02:59:55 +00:00
|
|
|
|
* Table of Contents :TOC_4_gh:noexport:
|
|
|
|
|
- [[#description][Description]]
|
|
|
|
|
- [[#layer-installation][Layer Installation]]
|
|
|
|
|
- [[#layer][Layer]]
|
|
|
|
|
- [[#eclim][Eclim]]
|
|
|
|
|
- [[#installation][Installation]]
|
|
|
|
|
- [[#usage][Usage]]
|
|
|
|
|
- [[#key-bindings][Key bindings]]
|
|
|
|
|
- [[#java-mode][Java-mode]]
|
|
|
|
|
- [[#project-management][Project management]]
|
2016-08-03 21:53:00 +00:00
|
|
|
|
- [[#eclimd][Eclimd]]
|
2016-03-31 02:59:55 +00:00
|
|
|
|
- [[#maven][Maven]]
|
|
|
|
|
- [[#goto][Goto]]
|
|
|
|
|
- [[#refactoring][Refactoring]]
|
|
|
|
|
- [[#documentation-find][Documentation, Find]]
|
|
|
|
|
- [[#problems][Problems]]
|
|
|
|
|
- [[#tests][Tests]]
|
|
|
|
|
- [[#problems-buffer][Problems buffer]]
|
|
|
|
|
- [[#projects-buffer][Projects buffer]]
|
2015-07-04 04:55:38 +00:00
|
|
|
|
|
|
|
|
|
* Description
|
|
|
|
|
This layer adds support for the Java language using the [[http://eclim.org][Eclim]] client/server.
|
|
|
|
|
|
|
|
|
|
* Layer Installation
|
|
|
|
|
** Layer
|
2016-01-06 05:21:55 +00:00
|
|
|
|
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
|
|
|
|
|
add =java= to the existing =dotspacemacs-configuration-layers= list in this
|
|
|
|
|
file.
|
2015-07-04 04:55:38 +00:00
|
|
|
|
|
|
|
|
|
** Eclim
|
|
|
|
|
Eclim provides the ability to access Eclipse features such as code completion,
|
|
|
|
|
searching, code validation, and many more.
|
|
|
|
|
|
|
|
|
|
*** Installation
|
|
|
|
|
For installation check the [[http://eclim.org/install.html#download][official page]].
|
|
|
|
|
|
2015-09-28 06:05:18 +00:00
|
|
|
|
Then set the =Eclipse= and =Eclim= paths in =dotspacemacs/user-config=,
|
2015-07-04 04:55:38 +00:00
|
|
|
|
for instance:
|
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC elisp
|
2016-08-05 19:18:32 +00:00
|
|
|
|
(setq eclim-eclipse-dirs "~/opt/eclipse"
|
|
|
|
|
eclim-executable "~/opt/eclipse/eclim")
|
2015-07-04 04:55:38 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2016-08-05 19:18:32 +00:00
|
|
|
|
You can also configure other options, as shown below:
|
2016-08-03 21:53:00 +00:00
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC elisp
|
2016-08-05 19:18:32 +00:00
|
|
|
|
(setq
|
|
|
|
|
;; Use another eclimd executable
|
|
|
|
|
eclimd-executable "/path/to/another/executable"
|
|
|
|
|
;; Specify the workspace to use by default
|
|
|
|
|
eclimd-default-workspace "/path/to/default/eclipse/workspace"
|
|
|
|
|
;; Whether or not to block emacs until eclimd is ready
|
|
|
|
|
eclimd-wait-for-process t)
|
2016-08-03 21:53:00 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2015-07-04 04:55:38 +00:00
|
|
|
|
*** Usage
|
2016-08-05 19:18:32 +00:00
|
|
|
|
Start the eclim daemon with ~SPC m d s~ and stop it with ~SPC m d k~. (See
|
|
|
|
|
below.)
|
2015-07-04 04:55:38 +00:00
|
|
|
|
|
|
|
|
|
* Key bindings
|
|
|
|
|
** Java-mode
|
|
|
|
|
*** Project management
|
2016-04-13 03:31:38 +00:00
|
|
|
|
|
2015-07-04 04:55:38 +00:00
|
|
|
|
| Key Binding | Description |
|
|
|
|
|
|-------------+--------------------------------|
|
|
|
|
|
| ~SPC m p b~ | Build project |
|
|
|
|
|
| ~SPC m p c~ | Create project |
|
|
|
|
|
| ~SPC m p d~ | Delete project |
|
|
|
|
|
| ~SPC m p g~ | Open file in current project |
|
|
|
|
|
| ~SPC m p i~ | Import project |
|
|
|
|
|
| ~SPC m p j~ | Information about project |
|
|
|
|
|
| ~SPC m p k~ | Close project |
|
|
|
|
|
| ~SPC m p o~ | Open project |
|
2016-02-28 02:33:39 +00:00
|
|
|
|
| ~SPC m p p~ | Open project management buffer |
|
2015-07-04 04:55:38 +00:00
|
|
|
|
| ~SPC m p u~ | Update project |
|
|
|
|
|
|
2016-08-03 21:53:00 +00:00
|
|
|
|
*** Eclimd
|
|
|
|
|
|
|
|
|
|
| Key Binding | Description |
|
|
|
|
|
|-------------+--------------|
|
2016-08-05 19:18:32 +00:00
|
|
|
|
| ~SPC m d s~ | Start daemon |
|
|
|
|
|
| ~SPC m d k~ | Stop daemon |
|
2016-08-03 21:53:00 +00:00
|
|
|
|
|
2015-07-04 04:55:38 +00:00
|
|
|
|
*** Maven
|
2016-04-13 03:31:38 +00:00
|
|
|
|
|
2015-07-04 04:55:38 +00:00
|
|
|
|
| Key Binding | Description |
|
|
|
|
|
|-------------+--------------------------------|
|
|
|
|
|
| ~SPC m m i~ | Run maven clean install |
|
|
|
|
|
| ~SPC m m I~ | Run maven install |
|
|
|
|
|
| ~SPC m m p~ | Run one already goal from list |
|
|
|
|
|
| ~SPC m m r~ | Run maven goals |
|
|
|
|
|
| ~SPC m m R~ | Run one maven goal |
|
|
|
|
|
| ~SPC m m t~ | Run maven test |
|
|
|
|
|
|
|
|
|
|
*** Goto
|
2016-04-13 03:31:38 +00:00
|
|
|
|
|
2015-07-04 04:55:38 +00:00
|
|
|
|
| Key Binding | Description |
|
|
|
|
|
|-------------+---------------------------------------------|
|
2016-02-29 09:23:14 +00:00
|
|
|
|
| ~M-,~ | jump back from go to declaration/definition |
|
2015-07-04 04:55:38 +00:00
|
|
|
|
| ~SPC m g g~ | go to declaration |
|
|
|
|
|
| ~SPC m g t~ | go to type definition |
|
|
|
|
|
|
|
|
|
|
*** Refactoring
|
2016-04-13 03:31:38 +00:00
|
|
|
|
|
2015-07-04 04:55:38 +00:00
|
|
|
|
| Key Binding | Description |
|
|
|
|
|
|-------------+------------------|
|
|
|
|
|
| ~SPC m r i~ | optimize imports |
|
|
|
|
|
| ~SPC m r f~ | Format file |
|
|
|
|
|
| ~SPC m r r~ | Rename symbol |
|
|
|
|
|
|
|
|
|
|
*** Documentation, Find
|
2016-04-13 03:31:38 +00:00
|
|
|
|
|
2015-07-04 04:55:38 +00:00
|
|
|
|
| Key Binding | Description |
|
|
|
|
|
|-------------+----------------------------------------|
|
|
|
|
|
| ~SPC m f f~ | general find in project |
|
|
|
|
|
| ~SPC m h h~ | show documentation for symbol at point |
|
|
|
|
|
| ~SPC m h u~ | show usages for symbol at point |
|
|
|
|
|
|
|
|
|
|
*** Problems
|
2016-04-13 03:31:38 +00:00
|
|
|
|
|
2015-07-04 04:55:38 +00:00
|
|
|
|
| Key Binding | Description |
|
|
|
|
|
|-------------+--------------------------------------------|
|
|
|
|
|
| ~SPC m e a~ | set all problems for next/prev action |
|
|
|
|
|
| ~SPC m e b~ | open buffer with problems |
|
|
|
|
|
| ~SPC m e c~ | show options with problem corrections |
|
|
|
|
|
| ~SPC m e e~ | set only errors for next/prev action |
|
|
|
|
|
| ~SPC m e f~ | set only current file for next/prev action |
|
|
|
|
|
| ~SPC m e n~ | go to next problem |
|
|
|
|
|
| ~SPC m e o~ | open buffer with problems |
|
|
|
|
|
| ~SPC m e p~ | go to previous problem |
|
|
|
|
|
| ~SPC m e w~ | set warnings for next/prev action |
|
|
|
|
|
|
|
|
|
|
*** Tests
|
2016-04-13 03:31:38 +00:00
|
|
|
|
|
2015-07-04 04:55:38 +00:00
|
|
|
|
| Key Binding | Description |
|
|
|
|
|
|-------------+---------------------------------------------------------------|
|
|
|
|
|
| ~SPC m t t~ | run JUnit tests for current method or current file or project |
|
|
|
|
|
|
|
|
|
|
** Problems buffer
|
2016-04-13 03:31:38 +00:00
|
|
|
|
|
2015-07-04 04:55:38 +00:00
|
|
|
|
| Key Binding | Description |
|
|
|
|
|
|-------------+-------------------------------------|
|
|
|
|
|
| ~RET~ | go to problem place |
|
|
|
|
|
| ~a~ | show all problems |
|
|
|
|
|
| ~e~ | show only errors |
|
|
|
|
|
| ~f~ | show problems only for current file |
|
|
|
|
|
| ~g~ | refresh problems |
|
|
|
|
|
| ~q~ | quit |
|
|
|
|
|
| ~w~ | show only warnings |
|
|
|
|
|
|
|
|
|
|
** Projects buffer
|
2016-04-13 03:31:38 +00:00
|
|
|
|
|
2015-07-04 04:55:38 +00:00
|
|
|
|
| Key Binding | Description |
|
|
|
|
|
|-------------+--------------------------------------------|
|
|
|
|
|
| ~RET~ | go to current project |
|
|
|
|
|
| ~c~ | go to problem place |
|
|
|
|
|
| ~D~ | delete project |
|
|
|
|
|
| ~g~ | refresh buffer |
|
|
|
|
|
| ~i~ | info about current project |
|
|
|
|
|
| ~I~ | import existing project into the workspace |
|
|
|
|
|
| ~m~ | mark current project |
|
|
|
|
|
| ~M~ | mark all projects |
|
|
|
|
|
| ~N~ | create new project |
|
|
|
|
|
| ~o~ | open project |
|
|
|
|
|
| ~p~ | update project |
|
|
|
|
|
| ~q~ | quit |
|
|
|
|
|
| ~R~ | rename current project |
|
|
|
|
|
| ~u~ | unmark current project |
|
|
|
|
|
| ~U~ | unmark all projects |
|