vscode-java: The Language Support for Java server crashed 5 times in the last 3 minutes. The server will not be restarted.
Receiving the following error when opening a Maven project folder:
The Language Support for Java server crashed 5 times in the last 3 minutes. The server will not be restarted.
Environment
-
Operating System: Windows 10
-
JDK version: both java version “1.8.0_141” AND openjdk version “11.0.1” 2018-10-16
-
Visual Studio Code version: Version: 1.29.1 (user setup) Commit: bc24f98b5f70467bc689abf41cc5550ca637088e Date: 2018-11-15T19:13:36.375Z Electron: 2.0.12 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 Architecture: x64
-
Java extension version: 0.35.0 (November 30th, 2018)
Steps To Reproduce
- Install the Language Support for Java™ by Red Hat extension (no other extensions are active)
- Create a new Maven project using the quickstart archetype
- Open the folder with the new Maven project
- See the error
I am unable to attach the Java Language Server log file. I followed the steps here, but when I run the the Java: Open Java Language Server log file
command nothing happens.
Current Result
Expected Result
Additional Informations
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 40 (3 by maintainers)
Press CTRL + SHIFT + P, and type Java: Clean Java Language Server Workspace. It works for me.
Thank you for giving me the “java.jdt.ls.vmargs” setting, I was able to figure out what was going wrong.
I had installed the Lombok Annotations Support for VS Code extension awhile back and decided to remove it. However, the extension added some parameters to the java.jdt.ls.vmargs setting:
"-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication -javaagent:\"C:\\Users\\SHall\\.vscode\\extensions\\gabrielbb.vscode-lombok-0.9.7/server/lombok.jar\" -Xbootclasspath/a:\"C:\\Users\\SHall\\.vscode\\extensions\\gabrielbb.vscode-lombok-0.9.7/server/lombok.jar\""
When I removed the extension, the settings were still present but the Language Server was unable to the load the manifest from the lombok.jar file (because it was deleted). This caused the Language Server to fail to start.
After adding the
-Dlog.level=ALL
parameter to the java.jdt.ls.vmargs setting, I was finally able to see the error in the output view. I’ve put the java.jdt.ls.vmargs setting back to its default value and everything is working properly again.Thank you for your help! You can close this issue.
i delete that folder , did not fix . i use windows, it is C:\Users\[username]\AppData\Roaming\Code\User
Had this issue but Cleaning and Restarting the server did not fix it. (Note: Having a second vscode instance running another Java project may have suppressed the Cleaning process.) So I brought both instances down and just deleted my
~/.config/Code/User/workspaceStorage
directory. Restarting my VsCode recreated it and all was good.I have tried all the above hacks nothing works as I tried to fix one another got breaked up… But here is a simple solution to realy get rid of this error.
%APPDATA%\Code
macOS:$HOME/Library/Application Support/Code
Now Delete thiscode
folder.C:\Users
<username>
Delete.vscode
folder in it too.I’d be curious if disabling the AV (probably wanna be offline for that) makes any difference. And I know nothing about AVs, except they can wreak havoc sometimes.
In your settings.json, try to :
"java.trace.server":"verbose"
-Dlog.level=ALL
to the default “java.jdt.ls.vmargs” valueafter restarting, get the Java server logs from VS Code’s Output view
the problem gets fixed by itself when I switched to the pre-release version of the extension. Thanks for your help anyway!!