emacs-lsp/lsp-java

Lombok support does not work

Opened this issue · 2 comments

Describe the bug
Lombok support is manually set to "t" in customize but jdtls does not start with the Lombok support args.

To Reproduce
open a project that uses Lombok with lsp-java
ps aux | grep -i lombok | grep -v grep returns 0 results

Expected behavior
Lombok support is loaded and recognizes annotations.

Lombok is not working for me either.

rbarbey commented

What's working for me was to add Lombok as a javaagent to the JVM args like this

(use-package lsp-java
  :hook (java-mode . lsp-deferred)
  :init
  (setq lsp-java-vmargs (list
                         "-Xmx1G"
                         "-XX:+UseG1GC"
                         "-XX:+UseStringDeduplication"
                         "-javaagent:/path/to/home/.m2/repository/org/projectlombok/lombok/1.18.22/lombok-1.18.22.jar")))

Be sure to adapt the path to where your local Maven repo is and the version you have.