Meghanada
is a new minor-mode (meghanada-mode
) that aims at improving the editing
experience for the Java. It works by using a combination of an Emacs
package and meghanada-server.
Features:
- Easy install
- Auto update server module
- Gradle and Maven project support
- No need build tool's plugin
- Run build tool task
- Compile your project
- Analyze java source
- Support
Generics
- Code completion with company-mode (
company-meghanada
) - Optimize import
- Jump declaration
- Run Junit test (include test runner)
- Diagnostic reporting with flycheck (
flycheck-meghanada
)
Meghanada
tested only linux
(maybe macOS OK). windows not support.
Meghanada has been developed Emacs 25.1.1
Package | Version |
---|---|
cl-lib |
0.5 |
yasnippet | 0.6.1 |
company-mode | 0.9.0 |
flycheck | 0.23 |
meghanada-mode
require meghanada-server and JDK (not JRE).
meghanada-server provides an interface to meghanada-mode
. It uses a simple protocol
based on S-expressions. This server, written in java, requires the following
packages to be installed on your system:
- JDK 1.8
Install meghanada from melpa.
(require 'meghanada)
(add-hook 'java-mode-hook
(lambda ()
;; meghanada-mode on
(meghanada-mode t)
(add-hook 'before-save-hook 'meghanada-code-beautify-before-save)))
The server will be automatically installed to ~/.meghanada/meghanada.jar
.
If you open a java file and set meghanada-mode
, a meghanada-server process starts automatically and connects to your emacs.
The server will be automatically updated.
M-x meghanada-update-server
type M-x customize-group RET meghanada
.
Here is a list of available interactive commands.
Download and install meghanada-server jar.
Download and update meghanada-server jar. and restart server process.
Start meghanada-server process and connect to server.
meghanada-mode
call this function by default. when open java file and set meghanada-mode
.
Restart meghanada-server process and client process.
Kill meghanada-server process.
Connect to other meghanada-server directly.
Connect to meghanada-server .
Disconnect from meghanada-server .
Send ping meghanada-server
Clear meghanada-server's project cache data.
Add import all unqualified classes.
Import all and remove unused import statement.
Introduce local variable. (need expression is end ;
)
Compile file.
Compile project.
Switch testcase or source.
Run Junit .
Run Junit testcase (select from imenu).
Run build tool task.
Goto declaration.
Go back from declaration position.
Format buffer code.
See *meghanada-server-log*
buffer.
- Refactoring
Contributions are extremely welcome!
Please push PR to dev
branch.
GPL v3, See LICENSE file.