doomemacs/modules/lang/java
Henrik Lissner 3ce5d96e0a
bump: :lang
ShuguangSun/ess-view-data@5ec1c7206f -> ShuguangSun/ess-view-data@7dcbd23d4c
agda/agda@0d52fa2217 -> agda/agda@bb9e13d970
ardumont/markdown-toc@d3324cb6bc -> ardumont/markdown-toc@29e5c0f33e
atomontage/xterm-color@ce82e87ea3 -> atomontage/xterm-color@86fab1d247
babashka/neil@0b7373dd1b -> babashka/neil@8d5ccdbd81
clojure-emacs/cider@fb7aa88812 -> clojure-emacs/cider@15bd3b0265
clojure-emacs/clojure-mode@28dc02114a -> clojure-emacs/clojure-mode@4679222109
crystal-lang-tools/emacs-crystal-mode@d913fea6f0 -> crystal-lang-tools/emacs-crystal-mode@559e1d8ff9
davazp/graphql-mode@ee49531935 -> davazp/graphql-mode@ef757c6ce2
emacs-ess/ESS@7b9123669c -> emacs-ess/ESS@f8c464dc1b
emacs-geiser/gauche@9eb8b35f0c -> emacs-geiser/gauche@b8197c6288
emacs-geiser/geiser@43b9a034aa -> emacs-geiser/geiser@8842104d15
emacs-lsp/lsp-treemacs@3e5550f278 -> emacs-lsp/lsp-treemacs@49df7292c5
emacs-php/composer.el@eba6b953a4 -> emacs-php/composer.el@8cb5704edd
emacs-straight/auctex@a6f4741c22 -> emacs-straight/auctex@077874d25a
emacsmirror/cmake-mode@b08b5d9045 -> emacsmirror/cmake-mode@25340a7d12
emacsorphanage/dart-mode@9fbf703e1f -> emacsorphanage/dart-mode@773e9ebc74
emacsorphanage/ox-pandoc@5766c70b6d -> emacsorphanage/ox-pandoc@1caeb56a4b
emacsorphanage/restclient@426507f8f7 -> emacsorphanage/restclient@1800a4e367
erlang/otp@e281016db9 -> erlang/otp@2b2b39797f
fxbois/web-mode@1eb0abb1a9 -> fxbois/web-mode@1e7694aee8
gcv/julia-snail@7b50882f5a -> gcv/julia-snail@5a7e2d479c
godotengine/emacs-gdscript-mode@79739fc80f -> godotengine/emacs-gdscript-mode@248b73b1bd
greghendershott/racket-mode@d98852ef6d -> greghendershott/racket-mode@150b057953
hhvm/hack-mode@0addbff8b6 -> hhvm/hack-mode@86a981bd7b
https://codeberg.org/pranshu/haskell-ts-mode@b7db74c7fe96 -> https://codeberg.org/pranshu/haskell-ts-mode@bf143ee8382f
joaotavora/sly@6a303bae74 -> joaotavora/sly@b01993cf1d
ledger/ledger-mode@1cee636788 -> ledger/ledger-mode@9ab399186f
magit/orgit-forge@15f8e91083 -> magit/orgit-forge@c2116b8701 (v1.1.1)
magit/orgit@e0b3fca9f3 -> magit/orgit@24c8fe48c4 (v2.1.1)
mekeor/nael@101726eb47 -> mekeor/nael@9711443449
minad/org-modern@55b5bbeb1e -> minad/org-modern@9bbc44cc7e
nonsequitur/inf-ruby@b8076aad10 -> nonsequitur/inf-ruby@274398a242
ocaml/dune@a40c461736 -> ocaml/dune@14df34d30d
ocaml/merlin@ecfbed3976 -> ocaml/merlin@a0b096c243
oer/org-re-reveal@72c2463782 -> oer/org-re-reveal@8245facfdc
org-noter/org-noter@aafa08a49c -> org-noter/org-noter@81765d267e
org-roam/org-roam@b2634a17f8 -> org-roam/org-roam@c72702cf27
polymode/polymode@25ba9463a4 -> polymode/polymode@14b1fd8d2a
rust-lang/rust-mode@2d31814676 -> rust-lang/rust-mode@ae161dca23
wbolster/emacs-python-pytest@ed2ecee09d -> wbolster/emacs-python-pytest@78b5ea1d19
weijiangan/flycheck-golangci-lint@38cc30eb8b -> weijiangan/flycheck-golangci-lint@f7e36e19d6

Close: #8624
2026-01-18 03:13:00 -05:00
..
autoload feat(java): java.el takes java-ts-mode into account 2024-03-10 00:54:34 -05:00
+lsp.el fix: file-name-concat paths instead of concat 2025-12-30 22:59:10 -05:00
.doommodule feat: add .doommodule files 2024-09-14 20:47:39 -04:00
config.el merge: branch 'feature/treesit' 2025-08-31 14:55:37 +02:00
doctor.el feat(java): add treesit support 2025-08-27 17:29:58 +02:00
packages.el bump: :lang 2026-01-18 03:13:00 -05:00
README.org refactor!(java): remove +eclim and +meghanada 2025-04-15 04:54:22 -04:00

: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).
+tree-sitter
Leverages tree-sitter for better syntax highlighting and structural text editing. Requires doom-module::tools tree-sitter.

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:

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:

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?