Enterprise Java Development in Emacs | skybert.net

Enterprise Java Development in Emacs


Support for Lombok

(setq lsp-java-vmargs

Trouble shooting

If lsp-java doesn't work, a good place to start is to look in the Eclipse server log file:

$ tail -f ~/.emacs.d/workspace/.metadata/.log

java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer;

You need to make the language server use Java 9 and it must be OpenJDK:

(setq lsp-java-java-path

See this ticket over at jira.mongodb.org for a good explanation of why these errors happen


java.security.InvalidAlgorithmParameterException: the
trustAnchors parameter must be non-empty

The easiest solution is to just use OpenJDK instead of Oracle Java to run the Eclipse server (I just did apt-get install openjdk-9-jdk), you can set this in your .emacs by setting lsp-java-java-path, see above.

NoClassDefFoundError: javax/annotation/processing/AbstractProcessor

!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
java.lang.NoClassDefFoundError: javax/annotation/processing/AbstractProcessor
    at java.base/java.lang.ClassLoader.findBootstrapClass(Native Method)
    at java.base/java.lang.ClassLoader.findBootstrapClassOrNull(ClassLoader.java:1248)
    at java.base/java.lang.System$2.findBootstrapClassOrNull(System.java:2123)

Other Java extensions for Emacs I've used

Licensed under CC BY Creative Commons License ~ gmail torstein.k.johansen @ gmail ~ twitter @torsteinkrause ~