Re: lsp-java JDT keeps crashing, suspect too many projects in workspace src
Steinar Bang <[email protected]> Thu, 14 May 2026 12:14:55 +0200
| Newsgroups | gmane.emacs.help |
|---|---|
| Message-ID | <[email protected]> |
>>>>> Steinar Bang <[email protected]>: > I have started a discussion for this problem, on the lsp-mode github forum > https://github.com/emacs-lsp/lsp-mode/discussions/5049 > Perhaps a more appropriate forum? I've answered my own posting here with some fresh experiments: https://github.com/emacs-lsp/lsp-mode/discussions/5049#discussioncomment-16917293 What I did today: 1. Stopped all emacs instances 2. Added the following to my ~/.emacs (I want JDTLS for maven multi module java projects and I use already use projectile, not sure how much effect excluding the eclipse directories and files have, but they weren't already in the list, so... every little helps...): ;; Add some eclipse generated files and directories to lsp-mode's list of ignored files (with-eval-after-load 'lsp-mode (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\.project$") (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\.classpath$") (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\.settings$")) ;; Adapt lsp-mode to the projects I want lsp-mode for (i.e. maven java projects (most are multi-module maven projects) all handled by projectile) (setopt lsp-auto-guess-root t ; use projectile to guess project roots lsp-java-import-maven-enabled t ; same as default, but left in to make clear we're dealing with maven projects lsp-java-configuration-maven-user-settings nil) ; also same as default, left in for the same reason 3. Deleted the existing JDTLS rm -rf ~/.emacs.d/.cache/lsp/eclipse.jdt.ls/ 4. Started a fresh emacs and tried installing JDTLS with M-x lsp-install-server but JDTLS install didn't happen, ~/.emacs.d/.cache/lsp/stayed empty 5. Googled a little and what I found made me delete ~/.emacs.d/.lsp-session-v1 6. After deletion of .lsp-session-v1 JDTLS installation continued on its own without needing any intervention from me I'm now back up with a fresh emacs and a fresh config and a fresh JDTLS, and things seems to be working. At least JDTLS isn't crashing for me all the time now, with just a single eclipse workspace imported. Time will show how JDTLS and lsp-mode handles getting more eclipse workspaces in the list (most of my projects are maven multi module java projects, where the top pom directory also serves as an eclipse workspace).