Skip to content
This repository has been archived by the owner on Oct 16, 2021. It is now read-only.

Java and optional Lombok support #3

Closed
ChristianChiarulli opened this issue Mar 21, 2021 · 6 comments
Closed

Java and optional Lombok support #3

ChristianChiarulli opened this issue Mar 21, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ChristianChiarulli
Copy link

Awesome plugin I definitely plan to use it.

Any plans to support Java?

@kabouzeid
Copy link
Owner

I'll look into it. What is the preferred language server for Java these days?

@kabouzeid kabouzeid added enhancement New feature or request good first issue Good for newcomers labels Mar 21, 2021
@kabouzeid kabouzeid self-assigned this Mar 21, 2021
@ChristianChiarulli
Copy link
Author

@kabouzeid This should be all you need to get started. Ping me if you want to discuss anything there, I've setup the langserver with Lombok a few times already.

In the wiki there is a in depth config.

@kabouzeid kabouzeid mentioned this issue Mar 28, 2021
@jemag
Copy link

jemag commented Apr 4, 2021

I think Christian forgot to paste a link.
Either way, https://github.com/mfussenegger/nvim-jdtls has a good guide on setting up the java language-server (you can check both the README and wiki). For lombok, the launch script can be modified like so by adding -javaagent -Xbootclasspath/a for your lombok jar path, e.g.:

 #!/bin/bash

JAR="$HOME/dev/eclipse/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_*.jar"
export GRADLE_HOME=/usr/bin/gradle
java \
  -Declipse.application=org.eclipse.jdt.ls.core.id1 \
  -Dosgi.bundles.defaultStartLevel=4 \
  -Declipse.product=org.eclipse.jdt.ls.core.product \
  -Dlog.protocol=true \
  -Dlog.level=ALL \
  -Xms1g \
  -Xmx2G \
  -javaagent:/home/jemag/.config/nvim/dependencies/lombok.jar \
  -Xbootclasspath/a:/home/jemag/.config/nvim/dependencies/lombok.jar \
  -jar $(echo "$JAR") \
  -configuration "$HOME/dev/eclipse/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/config_linux" \
  -data "$1" \
  --add-modules=ALL-SYSTEM \
  --add-opens java.base/java.util=ALL-UNNAMED \
  --add-opens java.base/java.lang=ALL-UNNAMED

@kabouzeid
Copy link
Owner

I don't think any of this will work in a way that fits with this plugin (install servers with one command).

I can't assume the location of gradle, jdk and workspace. Since you have to manually configure this server anyways, I don't think :LspInstall java would buy you much.

@kabouzeid
Copy link
Owner

@ChristianChiarulli @jemag @GustavoPrietoP @alanjjenkins I've merged support for Java + Lombok (with great help from @alanjjenkins). Could you try and tell me if this works for you?

@GustavoPrietoP
Copy link

@ChristianChiarulli @jemag @GustavoPrietoP @alanjjenkins I've merged support for Java + Lombok (with great help from @alanjjenkins). Could you try and tell me if this works for you?

hey, i just tested it out and it seems like it works :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants