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.
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)
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.
I've also set up Code to run on the Windows Ubuntu app an am getting the same error.
I tried cleaning the workspace directory as per the instructions found here, but I am getting the same error.
do you see any org.eclipse.equinox.launcher*.jar processes when running jps? If you find any try to kill them.
Also, try to run with the latest Java 1.8 version.
There are no jps processes running other than jps itself.
I've updated to the latest version of JDK 8 (java version "1.8.0_191"), but I'm getting the same error.
I was able to manually start the Eclipse JDT Language Server following the instructions here, so I know it will run (although I still get the same error in code even if the server is manually started).
any antivirus running?
It's a corporate PC, so, unfortunately, yes. However, I'm not see anything in it's logs about it blocking any java or code processes. Also, I was able to (temporarily) borrow a PC and I'm not getting any errors there when I load a Java project in code. (I suppose they could be using different antivirus definitions, but they're both corporate so they should be in sync.)
Those in change of such things have decided to use Carbon Black for AV protection. Do you know of any specific issues with Carbon Black?
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
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.
Ok, good to know, that info might be helpful to others
I had this problem too and it had occurred after i changed my _JAVA_OPTIONS env variable on Windows. I noticed that some plugins import their own setting in VS Code Settings -> settings.json
To fix the error - You have to update them with -Xmx to be larger than the system -Xms value.
I made them identical in both locations and the error is gone. Hope this helps!
I also had this error caused by lombok in combination with the Remote - SSH Extension.
The java.jdt.ls.vmargs setting in settings.json was set to the path of lombok on my local machine. (- javaagent:\"C:\\Users\\<user>\\.vscode\\extensions\\gabrielbb.vscode-lombok-1.0.1\\lombok.jar\")
However it needs the path of lombok on the remote machine. (-javaagent:\"/home/ubuntu/.vscode-server/extensions/gabrielbb.vscode-lombok-1.0.1/server/lombok.jar\")
@FieteO Your concern is fair enough, i also created an issue at the vscode-lombok extension side https://github.com/GabrielBB/vscode-lombok/issues/43.
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=ALLparameter 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.
Thanks !! I had the same problem here . Installed lombok and after that deleted it but the settings for it remain, just deleted it.
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 $HOME/Library/Application Support/Code code folder. C:\Users\ .vscode folder in it too.
Most helpful comment
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=ALLparameter 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.