You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Language server jdtls: from extension "Java" version 6.8.2: No such file or directory (os error 2) #155
I confirmed that this is not an issue with the Eclipse JDT Language Server itself
What happened?
Hi! I'm so so sorry if this isn't the right place to ask this or if I'm just doing something wrong, I'm a beginner and I've been trying to set up the java extension for quite a while, and I keep getting this error:
Language server jdtls:
from extension "Java" version 6.8.2: No such file or directory (os error 2)
I read through the instructions and I did double check just to make sure that JAVA_HOME was set and that java was on my path, and I don't see any problems with that, but just in case it's helpful this is what they are both set to in my environment:
❯ echo $JAVA_HOME
/home/allie/.local/share/mise/installs/java/temurin-21.0.9+10.0.LTS
❯ which java
/home/allie/.local/share/mise/installs/java/temurin-21.0.9+10.0.LTS/bin/java
I've tried it both with Java 25 originally, and then also with Java 21, and neither one was working so I'm not sure if I'm just doing something wrong. I know it isn't a problem with jdtls itself because when I look in the java extension directory it hasn't even been downloaded (and I might have misunderstood, but I thought that the extension does that automatically by default), and I've tried looking through other issues to see if I could get any hints, but I'm not really sure what to do now.
❯ ls -la ~/.local/share/zed/extensions/work/java/
drwxr-xr-x allie allie 12 B Sat Dec 20 15:15:03 2025 .
drwxr-xr-x allie allie 44 B Sat Dec 20 17:27:12 2025 ..
drwxr-xr-x allie allie 0 B Sat Dec 20 15:15:03 2025 lombok
Any help would be very very appreciated!!
What did you expect to happen?
I expected the extension to automatically download jdtls and run it, currently the only thing working is syntax highlighting.
Environment
Zed: 0.217.2
Platform: Arch Linux 6.18.1-arch1-2
Java: OpenJDK 25.0.1 and Eclipse Temurin 21.0.9
I've published PR #186 that is going to help you debug what is failing. If you're not familiar with installing development versions it should be available in a couple of days at the most.
I've published PR #186 that is going to help you debug what is failing. If you're not familiar with installing development versions it should be available in a couple of days at the most.
Sweet! So I just tried it, and this new error message is much more informative!
Language server jdtls:
from extension "Java" version 6.8.9: Failed to build JDTLS launch arguments:
Failed to determine Java version:
Failed to execute '/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/bin/java -version':
No such file or directory (os error 2)
Updating "java_home" in my config to be /opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home made the LSP load!
But now I get a bunch of unexpected errors reported by the LSP instead 😅 Here's one of them
I opened up the project again, and added another package. And that one works great.
So I tried renaming the existing package. And all of a sudden that one also started working.
So I tried renaming it back to the original, and now it's broken again.
Literally every other name, except for the original, works.
What is it that it doesn't like with the package name in my screenshot I posted earlier?
Unfortunately did not work. It made things worse. Now the new package files I added are also broken 😆
But thanks for letting me know about the clear cache task, I'm sure it'll come in handy in the future!
So maybe now I need to provide those JDTLS init options. I looked at #146 but the list there is so long! I have no idea where to even start and/or what I'd need to adapt to my setup
I copy/pasted those settings, and added my java_home setting that I added before.
Then I restarted the language server
Didn't help
So I cleared the cache, and restarted the language server again
Activity
fix: only quote paths on Windows to prevent macOS/Linux spawn() errors (
Tobbe commentedon Feb 4, 2026
I'm running into this same error message, but for v6.8.8
This is the first time I try to set up Java on this machine, so maybe something else is wrong
tartarughina commentedon Feb 6, 2026
@Tobbe were you able to configure the extension?
I see now how returning the OS's error without decorating it with the specific location where it happened is not the greatest UX wise.
I'll push a change so that these errors are all going to be decorated with the specific location where they were emitted.
Tobbe commentedon Feb 7, 2026
@tartarughina No, unfortunately did not figure out how to get past the error
tartarughina commentedon Feb 7, 2026
Could you share your extension config file? @Tobbe
The places where such error could be emitted are few and mostly related to Java exe location.
Tobbe commentedon Feb 7, 2026
@tartarughina of course, just tell me where to look and I'll copy/paste it for you
Tobbe commentedon Feb 7, 2026
If you just mean my settings file, it looks like this
tartarughina commentedon Feb 7, 2026
I was referring exactly to that, please look at the README for a reference setting.
Setting the java_home option is likely going to fix your issue
Tobbe commentedon Feb 7, 2026
I have this now
Where "java_home" is just a copy of my JAVA_HOME environment variable.
But I still get the same error
tartarughina commentedon Feb 7, 2026
I've published PR #186 that is going to help you debug what is failing. If you're not familiar with installing development versions it should be available in a couple of days at the most.
Tobbe commentedon Feb 7, 2026
Thanks! I'll wait for 6.8.9 and then try again :)
tartarughina commentedon Feb 7, 2026
@Tobbe new version available!
Tobbe commentedon Feb 7, 2026
Sweet! So I just tried it, and this new error message is much more informative!
Updating
"java_home"in my config to be/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Homemade the LSP load!But now I get a bunch of unexpected errors reported by the LSP instead 😅 Here's one of them
tartarughina commentedon Feb 7, 2026
Check out #146, similar issue as that one, you need to provide JDTLS some init options
Tobbe commentedon Feb 10, 2026
I opened up the project again, and added another package. And that one works great.
So I tried renaming the existing package. And all of a sudden that one also started working.
So I tried renaming it back to the original, and now it's broken again.
Literally every other name, except for the original, works.
What is it that it doesn't like with the package name in my screenshot I posted earlier?
tartarughina commentedon Feb 10, 2026
@Tobbe When you have a java file open, run the task for cleaning the cache. The issue you're facing might be caused by that.
Tobbe commentedon Feb 10, 2026
Unfortunately did not work. It made things worse. Now the new package files I added are also broken 😆
But thanks for letting me know about the clear cache task, I'm sure it'll come in handy in the future!
So maybe now I need to provide those JDTLS init options. I looked at #146 but the list there is so long! I have no idea where to even start and/or what I'd need to adapt to my setup
tartarughina commentedon Feb 10, 2026
@Tobbe If you don't plan to use the settings from #146 consider to use those from the README
If things are broken restart the language server, it might pick up either the change in the cache or in the settings in that way
Tobbe commentedon Feb 11, 2026
I copy/pasted those settings, and added my java_home setting that I added before.
Then I restarted the language server
Didn't help
So I cleared the cache, and restarted the language server again
Still getting the same error unfortunately
tartarughina commentedon Feb 12, 2026
@Tobbe check this out #39 (comment)
Tobbe commentedon Feb 12, 2026
Yes!!! Finally! 😁 It works now. I'm so happy 🎉
Thank you so much for helping me fix this 🙏