Skip to content

Latest commit

 

History

History
174 lines (143 loc) · 6.32 KB

README.org

File metadata and controls

174 lines (143 loc) · 6.32 KB

Java layer

img/java.png

Table of Contents

Description

This layer adds support for the Java language using the Eclim client/server.

Layer Installation

Layer

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.

Eclim

Eclim provides the ability to access Eclipse features such as code completion, searching, code validation, and many more.

Installation

For installation check the official page.

Then set the Eclipse and Eclim paths in dotspacemacs/user-config, for instance:

(setq eclim-eclipse-dirs "~/opt/eclipse"
      eclim-executable "~/opt/eclipse/eclim")

You can also configure other options, as shown below:

(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)

Usage

Start the eclim daemon with SPC m d s and stop it with SPC m d k. (See below.)

Key bindings

Java-mode

Project management

Key BindingDescription
SPC m p bBuild project
SPC m p cCreate project
SPC m p dDelete project
SPC m p gOpen file in current project
SPC m p iImport project
SPC m p jInformation about project
SPC m p kClose project
SPC m p oOpen project
SPC m p pOpen project management buffer
SPC m p uUpdate project

Eclimd

Key BindingDescription
SPC m d sStart daemon
SPC m d kStop daemon

Maven

Key BindingDescription
SPC m m iRun maven clean install
SPC m m IRun maven install
SPC m m pRun one already goal from list
SPC m m rRun maven goals
SPC m m RRun one maven goal
SPC m m tRun maven test

Goto

Key BindingDescription
M-​,​jump back from go to declaration/definition
SPC m g ggo to declaration
SPC m g tgo to type definition

Refactoring

Key BindingDescription
SPC m r ioptimize imports
SPC m r fFormat file
SPC m r rRename symbol

Documentation, Find

Key BindingDescription
SPC m f fgeneral find in project
SPC m h hshow documentation for symbol at point
SPC m h ushow usages for symbol at point

Problems

Key BindingDescription
SPC m e aset all problems for next/prev action
SPC m e bopen buffer with problems
SPC m e cshow options with problem corrections
SPC m e eset only errors for next/prev action
SPC m e fset only current file for next/prev action
SPC m e ngo to next problem
SPC m e oopen buffer with problems
SPC m e pgo to previous problem
SPC m e wset warnings for next/prev action

Tests

Key BindingDescription
SPC m t trun JUnit tests for current method or current file or project

Problems buffer

Key BindingDescription
RETgo to problem place
ashow all problems
eshow only errors
fshow problems only for current file
grefresh problems
qquit
wshow only warnings

Projects buffer

Key BindingDescription
RETgo to current project
cgo to problem place
Ddelete project
grefresh buffer
iinfo about current project
Iimport existing project into the workspace
mmark current project
Mmark all projects
Ncreate new project
oopen project
pupdate project
qquit
Rrename current project
uunmark current project
Uunmark all projects