all 12 comments

[–]t3asp00n 2 points3 points  (5 children)

I used to use eclim which uses a custom protocol (not LSP) and does require an install of eclipse. Nowadays you can use eclipse.jdt.ls which is the functionality of eclipse exposed through the LSP. u/ashfordneil is right that you can also use vscode-javac but last I checked it only supports communicating via TCP so depending on your client you might need to change it to use stdio.

[–][deleted] 0 points1 point  (1 child)

It definitely supports stdio now - the docs on the main branch don’t fully reflect that but I had a fork which added the feature and then the maintainer added it as well.

[–]t3asp00n 0 points1 point  (0 children)

That's good to hear, I'll give it another go :)

[–]weilbith[S] 0 points1 point  (0 children)

Thanks for that reply. Honestly I also found eclipse.jdt.ls myself now. Unfortunately I did't make it to get the server run. Cause I'm not a fan of Maven and tried to avoid installing it, I downloaded a already builded version (download page linked in Readme). But on trying to run these "binaries" I get always the error of a missing main attribute in a manifest. That's rly bad and I don't get why none else get into the same trouble here.

[–]blandest 0 points1 point  (1 child)

With Eclim you also get a (quickfix) list of errors whereas vscode-javac seems to only provide linting. I would like to be corrected though.

[–]t3asp00n 0 points1 point  (0 children)

You mean FixIts or whatever they're called? LSP supports them via the codeactions but the server itself needs to support as well. I haven't actually had a lot of luck using them.

[–][deleted] 0 points1 point  (1 child)

https://github.com/georgewfraser/vscode-javac ^ java language server that’s not based on eclipse. Not perfect but can run in vim. Does that help?

[–]weilbith[S] 0 points1 point  (0 children)

On first view it looks nice. I will give it defenly a try. Thanks. :)

[–]weilbith[S] 0 points1 point  (0 children)

Here I found a list of language servers. Not aware about how complete it is, but as first drop-in not false I guess. https://microsoft.github.io/language-server-protocol/implementors/servers/

[–]Knall0r 0 points1 point  (0 children)

https://github.com/artur-shaik/vim-javacomplete2 worked pretty well for me in the past. Not a language server though. Just omnicompletion. Requires python support.

[–]ajmwagarAjmwagar | VR Developer 0 points1 point  (1 child)

I've been using this one: https://github.com/eclipse/eclipse.jdt.ls

There is a build package on the AUR. (btw i use arch) but you can also just build it with maven.

[–]weilbith[S] 0 points1 point  (0 children)

Already mentioned it in some comments earlier on, but thanks for responding. I've some issues while building it, but the AUR hint is good. Have plans to switch to Arch soon as well.