Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep getting "Couldn't start client Language Support for Java" when opening a Java file in vscode. #1813

Closed
JLP04 opened this issue Feb 21, 2021 · 7 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#1683
Assignees
Labels

Comments

@JLP04
Copy link

JLP04 commented Feb 21, 2021

Whenever I open a .java file in a workspace, I get the errors "Couldn't start client Language Support for Java" and "Couldn't start client Language Support for Java (Syntax Server)". I was previously able to use the Java extension in this same workspace.

Environment
  • Operating System: macOS Big Sur 11.2.1
  • JDK version: 15.0.2
  • Visual Studio Code version: 1.53.2
  • Java extension version: 0.75.0
Steps To Reproduce
  1. Open a folder with .java files in vscode (one which was created with the "Java: Create Java Project" command.
  2. Open a .java file

[Please attach a sample project reproducing the error]
Monday Class.zip
Please attach logs
Logs.zip

Note: In the logs, I replaced some of the parts of the paths to my project location and also my username with ******* for privacy.

Current Result

Errors "Couldn't start client Language Support for Java" and "Couldn't start client Language Support for Java (Syntax Server)".

Expected Result

No error when loading vscode Java extension.

Additional Informations
@JLP04
Copy link
Author

JLP04 commented Mar 8, 2021

I believe that the error is from this part of client.log:

{ message: 'Error data: "java.lang.RuntimeException: java.lang.reflect.InvocationTargetException\\n\\tat org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)\\n\\tat org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)\\n\\tat org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)\\n\\tat org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)\\n\\tat org.eclipse.jdt.ls.core.internal.ParentProcessWatcher.lambda$0(ParentProcessWatcher.java:123)\\n\\tat org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)\\n\\tat org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)\\n\\tat org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)\\n\\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\\n\\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\\n\\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)\\n\\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)\\n\\tat java.base/java.lang.Thread.run(Thread.java:832)\\nCaused by: java.lang.reflect.InvocationTargetException\\n\\tat jdk.internal.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)\\n\\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\\n\\tat java.base/java.lang.reflect.Method.invoke(Method.java:564)\\n\\tat org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)\\n\\t... 12 more\\nCaused by: java.lang.IllegalArgumentException: URI is not absolute\\n\\tat java.base/java.net.URL.fromURI(URL.java:719)\\n\\tat java.base/java.net.URI.toURL(URI.java:1139)\\n\\tat org.eclipse.jdt.ls.core.internal.RuntimeEnvironment.getJavadocURL(RuntimeEnvironment.java:142)\\n\\tat org.eclipse.jdt.ls.core.internal.JVMConfigurator.configureJVMs(JVMConfigurator.java:107)\\n\\tat org.eclipse.jdt.ls.core.internal.JVMConfigurator.configureJVMs(JVMConfigurator.java:96)\\n\\tat org.eclipse.jdt.ls.core.internal.handlers.BaseInitHandler.handleInitializationOptions(BaseInitHandler.java:120)\\n\\tat org.eclipse.jdt.ls.core.internal.handlers.InitHandler.handleInitializationOptions(InitHandler.java:72)\\n\\tat org.eclipse.jdt.ls.core.internal.handlers.BaseInitHandler.initialize(BaseInitHandler.java:64)\\n\\tat org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.initialize(JDTLanguageServer.java:230)\\n\\t... 16 more\\n"\n' + '\n', level: 'info', timestamp: '2021-02-21 11:53:53.300' }

@testforstephen
Copy link
Collaborator

testforstephen commented Mar 9, 2021

"javadoc": "/Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home/docs/api"

The exception points out the failure is from invalid javadoc URL. Could you comment out the javadoc config for JDK 15 in your user setting?

@snjeza What's the correct format to configure the javadoc in "java.configuration.runtimes" setting?

@JLP04
Copy link
Author

JLP04 commented Mar 9, 2021

"javadoc": "/Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home/docs/api"

The exception points out the failure is from invalid javadoc URL. Could you comment out the javadoc config for JDK 15 in your user setting?

@snjeza What's the correct format to configure the javadoc in "java.configuration.runtimes" setting?

Commenting it out seems to fix it for now but I do want to figure out how to fix that javadoc URL.

@JLP04
Copy link
Author

JLP04 commented Mar 9, 2021

I think I managed to get it working by replacing "javadoc": "/Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home/docs/api" with "javadoc": "file:///Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home/docs/api". I didn't realize it was supposed to be a URL, I thought it could also be a local path.

@testforstephen
Copy link
Collaborator

Good to know you figured it out. Yes, there is room for us to improve this. Considering the peer keys in this setting support a local path, but not for javadoc is a bit confusing. Also the invalid URL should not break the starting of Java tooling itself.

@snjeza
Copy link
Contributor

snjeza commented Mar 9, 2021

What's the correct format to configure the javadoc in "java.configuration.runtimes" setting?

You can try https://docs.oracle.com/en/java/javase/15/docs/api/

@JLP04
Copy link
Author

JLP04 commented Mar 10, 2021

Thanks

@testforstephen testforstephen added this to the End March 2021 milestone Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants