sublimelsp / LSP-jdtls

Convenience package for the Eclipse JDT language server
https://packagecontrol.io/packages/LSP-jdtls
MIT License
30 stars 4 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'java' #39

Closed ilmoralito closed 1 year ago

ilmoralito commented 1 year ago

Sublime 4113 Ubuntu 22.04.1 java version 17.0.3-tem

When opening a .java file I am receiving the following error message:

Unable to start subprocess for jdtls FileNotFoundError: [Errno 2] No such file or directory: 'java'

In order to fix I try

LSP-jdtls settings

{
    "java.home": "/home/mario/.sdkman/candidates/java/current"
}

But the error message doesn't go away.

I installed java using sdkman. Greetings in advance

rchl commented 1 year ago

I don't know much about this server but I know that your setting is invalid. The java.home should be inside a settings object. Look at default settings and replicate the same structure.

ilmoralito commented 1 year ago

Thanks for answering. My mistake. I haven't noticed

This setup works as expected

{
    "settings": {
        "java.home": "/home/username/.sdkman/candidates/java/current"
    },
}