JuliaEditorSupport/julia-emacs@2aca8cf585 -> JuliaEditorSupport/julia-emacs@0f4d74f904 ProofGeneral/PG@b30d65de80 -> ProofGeneral/PG@d668946929 abicky/nodejs-repl.el@03d0b64768 -> abicky/nodejs-repl.el@130d49b073 agda/agda@819993172d -> agda/agda@3344ca8058 ardumont/markdown-toc@3d724e518a -> ardumont/markdown-toc@d2fb4cbd95 babashka/neil@78ffab1868 -> babashka/neil@0b7373dd1b clojure-emacs/cider@c228dec27d -> clojure-emacs/cider@f00e83d338 clojure-emacs/clojure-mode@59888c84b6 -> clojure-emacs/clojure-mode@eabe29b076 davazp/graphql-mode@c3baca9280 -> davazp/graphql-mode@ee49531935 dgutov/robe@6bc8a07fc4 -> dgutov/robe@ec4b7e74e9 diml/utop@b490baca21 -> diml/utop@3322adaa52 emacs-ess/ESS@8b4664e4a7 -> emacs-ess/ESS@c72b911d70 emacs-geiser/chicken@a480598b59 -> emacs-geiser/chicken@5f2c1bb446 emacs-geiser/geiser@97ce88463f -> emacs-geiser/geiser@74eed1669a emacs-jupyter/jupyter@e966c5d3d6 -> emacs-jupyter/jupyter@db8a9e233a emacs-lsp/lsp-metals@b5139c9593 -> emacs-lsp/lsp-metals@6a6a345a8a emacs-php/php-mode@31f702ee2d -> emacs-php/php-mode@0f756a8c07 emacs-rustic/rustic@9fdf5c76b2 -> emacs-rustic/rustic@e5c0271f1e emacs-straight/auctex@0de9730957 -> emacs-straight/auctex@f00256cbfd emacs-straight/org-mode@6a5d0ed342 -> emacs-straight/org-mode@5a4686915e emacsorphanage/macrostep@419873665f -> emacsorphanage/macrostep@44faf4f7bf erlang/otp@094260aba7 -> erlang/otp@3e7f126fe4 fxbois/web-mode@0c83581d1e -> fxbois/web-mode@be2d59c8fa gcv/julia-snail@dff92c4250 -> gcv/julia-snail@24f79a067b godotengine/emacs-gdscript-mode@bee7f99c6f -> godotengine/emacs-gdscript-mode@c3d9988984 greghendershott/racket-mode@c5bee6895b -> greghendershott/racket-mode@f2645aadd2 hakimel/reveal.js@0d02d8a303 -> hakimel/reveal.js@e15cf92ccd hvesalai/emacs-scala-mode@bd0638c32a -> hvesalai/emacs-scala-mode@661337d8aa jrblevin/markdown-mode@b8637bae07 -> jrblevin/markdown-mode@e100778594 jwiegley/emacs-async@af47d6f930 -> jwiegley/emacs-async@b99658e831 jwiegley/nix-update-el@aab70a3816 -> jwiegley/nix-update-el@77022ccd91 nonsequitur/inf-ruby@6399a36682 -> nonsequitur/inf-ruby@dad78a13f1 ocaml/dune@5ac095c7c0 -> ocaml/dune@098117d229 ocaml/merlin@a36f42a5b1 -> ocaml/merlin@3a806ef87f oer/org-re-reveal@91610ba9b0 -> oer/org-re-reveal@ab1422c163 org-roam/org-roam@2a630476b3 -> org-roam/org-roam@cad3518788 polymode/poly-R@e4a39caaf4 -> polymode/poly-R@8024e852cf polymode/polymode@15b6c1e94a -> polymode/polymode@74ba75d4bc psibi/dhall-mode@87ab69fe76 -> psibi/dhall-mode@fca383a9c4 purescript-emacs/purescript-mode@d187b3d4bb -> purescript-emacs/purescript-mode@07e4d6ecfe rwv/android-mode@d5332e339a -> rwv/android-mode@67f7c0d7d3 seagle0128/grip-mode@d6c7e33e40 -> seagle0128/grip-mode@df0ba7589d technomancy/fennel-mode@259470b297 -> technomancy/fennel-mode@3632cc77de tpapp/julia-repl@bb90cc1fce -> tpapp/julia-repl@317d560218
:lang java
Description unfold
This module adds Java support to Doom Emacs, including android-mode
and
groovy-mode
.
Maintainers
This module has no dedicated maintainers. Become a maintainer?
Module flags
- +lsp
-
Enable LSP support for
java-mode
. Requires doom-module::tools lsp and a langserver (supports eclipse.jdt.ls). Incompatible with doom-module:+meghanada. - +meghanada
- Enable doom-package:meghanada-mode. Incompatible with doom-module:+lsp.
- +tree-sitter
- Leverages tree-sitter for better syntax highlighting and structural text editing. Requires doom-module::tools tree-sitter.
Packages
- doom-package:android-mode
- doom-package:groovy-mode
- doom-package:meghanada if doom-module:+meghanada
-
- doom-package:eclim
- doom-package:company-emacs-eclim if doom-module::completion company
-
if doom-module:+lsp and not doom-module::tools lsp +eglot
Hacks
No hacks documented for this module.
TODO Changelog
This module does not have a changelog yet.
Installation
Enable this module in your doom!
block.
This module requires:
- Java SDK
- The LSP test runner requires doom-module::tools debugger +lsp (requires doom-package:dap-mode)
OpenJDK 11
Ubuntu
#+begin-src sh apt-get install openjdk-11-jdk-headless
#+end_src
Fedora
dnf install java-11-openjdk
Oracle JDK 11
Ubuntu
add-apt-repository ppa:linuxuprising/java
apt update
apt install oracle-java11-installer
apt install oracle-java11-set-default
Fedora
curl -O https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
tar zxvf openjdk-11.0.2_linux-x64_bin.tar.gz
sudo mv jdk-11.0.2/ /usr/local/
Open /etc/profile.d/jdk11.sh
as root and add:
export JAVA_HOME=/usr/local/jdk-11.0.2
export PATH=$PATH:$JAVA_HOME/bin
Save the file and source it:
source /etc/profile.d/jdk11.sh
java -version
Multiple Java Versions
It is common to need support for multiple Java versions. You can use a generic tool like jabba to install and manage multiple Java versions on any OS.
To have a different version of Java per-project, it is recommended you use
direnv and doom-module::tools direnv; create a .envrc
in the root of the project pointing
to the Java installation:
PATH_add ~/.jabba/jdk/adopt@1.11.0-3
JAVA_HOME=~/.jabba/jdk/adopt@1.11.0-3
And then run $ direnv allow .
in the project directory. The doom-module::tools direnv
module will automatically source this environment before activating LSP servers.
Formatter
doom-module::editor format uses google-java-format to handle formatting.
To install, grab the latest all-deps.jar
release from the above, put it
somewhere and create a script similar to the below:
/usr/local/bin/google-java-format
java -jar /path/to/google-java-format-all-deps.jar
TODO Usage
This module's usage documentation is incomplete. Complete it?
doom-module:+lsp features
According to https://github.com/emacs-lsp/lsp-java, you get:
- As you type reporting of parsing and compilation errors (via doom-package:flycheck or doom-package:lsp-ui)
- Code completion (doom-package:company-lsp or complete-at-point)
- Javadoc hovers (doom-package:lsp-ui)
- Code actions (doom-package:lsp-ui)
- Code outline (doom-package:imenu)
- Code navigation (doom-package:xref)
- Code lens for references/implementations (doom-package:xref)
- Highlights
- Code formatting
- Maven pom.xml project support
- Limited Gradle support
- Visual debugger (doom-package:dap-mode)
- Test runner (doom-package:dap-mode)
- Project explorer integration (doom-package:treemacs)
- Integration with Spring Initializr
+meghanada
features
According to https://github.com/mopemope/meghanada-emacs/, you get:
- Auto-update server module
- Gradle and Maven and Eclipse project support
- No need build tool's plugin
- Run build tool task
- Compile your project
- Syntax check and analyze java source (doom-package:flycheck-meghanada)
- Support
Generic Types
- Code completion with doom-package:company-mode (doom-package:company-meghanada)
- Optimize import and sort
- Jump declaration
- Run JUnit test (include test runner)
- Diagnostic reporting with doom-package:flycheck (doom-package:flycheck-meghanada)
- Show symbol's type info with doom-package:eldoc
- Search references
- Full-featured text search
TODO Configuration
This module's configuration documentation is incomplete. Complete it?
doom-module:+lsp
Install the eclipse server by executing M-x lsp-install-server
and selecting
jdtls
. After that any newly opened java
files should start the LSP server
automatically.
To update the server, perform SPC u M-x lsp-install-server
.
Note that if you change Java version you may need to remove the LSP server and
install it again. You can do this with M-x +lsp/uninstall-server
followed by
M-x lsp-install-server
.
Enable the doom-module::tools debugger +lsp module to get test runner support.
Troubleshooting
There are no known problems with this module. Report one?
Frequently asked questions
This module has no FAQs yet. Ask one?
TODO Appendix
This module has no appendix yet. Write one?