How can I set up LSP mode manually for Java in Emacs?
- Install
lsp-mode
andlsp-java
in Emacs. - Install
flycheck
(lsp-java
doesn't seem to work with the built-inflymake
in Emacs 27.1). - Download Eclipse JDT Language Server from https://projects.eclipse.org/projects/eclipse.jdt.ls, Downloads > Milestones builds > 0.70 > jdt-language-server-0.70.0-202103051608.tar.gz
- Set Emacs variable
lsp-java-server-install-dir
to extracted folder. - Download Java Debug Server for Visual Studio Code and build it using
mvn
https://github.com/microsoft/java-debug - Copy
com.microsoft.java.debug.plugin-0.30.0.jar
fromjava-debug\com.microsoft.java.debug.plugin\target\
tojdt-language-server-0.70.0-202103051608\bundles\
(add-hook 'java-mode-hook #'lsp)
Note: lsp-java
does support an automatic installation option; it's always interesting to see what goes on under the hood!
No comments:
Post a Comment