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

Windows 10 Couldn't start client Java Language Server even with java_home set #785

Open
Manish-Giri opened this issue Feb 3, 2019 · 40 comments

Comments

@Manish-Giri
Copy link

When I open a java project in VSCode and click on a .java file, I get the error - "Couldn't start client Java Language Server". Screenshot below -

1

I already have the JAVA_HOME environment variable set -

2

and also java.home set in VSCode user settings -

3

Environment
  • Operating System: Windows 10
  • JDK version: 11.0.1
  • Visual Studio Code version: 1.30.2
  • Java extension version: 0.38.0
Steps To Reproduce
  1. Open a java file in a java project
Additional Informations

I also get additional errors, like "Classpath is incomplete". Even though I opened a complete intellij generated project and a netbeans generated project in 2 different windows.

@snjeza
Copy link
Contributor

snjeza commented Feb 4, 2019

I already have the JAVA_HOME environment variable set -
2

@Manish-Giri Could you try set JAVA_HOME to C:\Program Files\Java\jdk-11.0.1?

@fbricon
Copy link
Collaborator

fbricon commented Feb 7, 2019

  • Open the command palette (F1)
  • select Developer: Toggle Developer Tools

report any errors you see in the console

@Leomedina
Copy link

I'm having the same issues... here's my log

"java.home": "C:\Program Files\Java\jdk-11.0.2"
Path set to C:\Program Files\Java\jdk-11.0.2\bin

--- LOG BELOW:

`TMSyntax.ts:50 Overwriting grammar scope name to file mapping for scope source.java.
Old grammar file: file:///c%3A/Users/medin/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/java/syntaxes/java.tmLanguage.json.
New grammar file: file:///c%3A/Users/medin/.vscode/extensions/georgewfraser.vscode-javac-0.2.13/lib/java.tmLanguage.json
e.register @ TMSyntax.ts:50
extensionHost.ts:325 [Extension Host] debugger listening on port 4045
extensionHost.ts:231 Extension Host
extensionHost.ts:232 Debugger listening on ws://127.0.0.1:4045/9145b838-c5bc-44fa-96a6-eaabd3385ae0
For help, see: https://nodejs.org/en/docs/inspector

log.ts:161 INFO no standard startup: panel is active
console.ts:134 [Extension Host] Activating Java
console.ts:134 [Extension Host] c:\Users\medin.vscode\extensions\georgewfraser.vscode-javac-0.2.13\dist\windows\bin\launcher
notificationsAlerts.ts:40 Couldn't start client Java Language Server
t.onDidNotificationChange @ notificationsAlerts.ts:40
log.ts:173 ERR spawn c:\Users\medin.vscode\extensions\georgewfraser.vscode-javac-0.2.13\dist\windows\bin\launcher ENOENT: Error: spawn c:\Users\medin.vscode\extensions\georgewfraser.vscode-javac-0.2.13\dist\windows\bin\launcher ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:229:19)
at onErrorNT (internal/child_process.js:406:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
console.ts:134 [Extension Host] rejected promise not handled within 1 second
t.log @ console.ts:134
log.ts:173 ERR Launching server using command c:\Users\medin.vscode\extensions\georgewfraser.vscode-javac-0.2.13\dist\windows\bin\launcher failed.
console.ts:134 [Extension Host] (node:9912) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
t.log @ console.ts:134
2console.ts:134 [Extension Host] settings: {"maxStringLength":0,"showStaticVariables":true,"showQualifiedNames":false,"showHex":false,"enableHotCodeReplace":true,"logLevel":"WARNING","javaHome":"C:\Program Files\Java\jdk-11.0.2\"}`

@snjeza
Copy link
Contributor

snjeza commented Feb 9, 2019

I'm having the same issues... here's my log
"java.home": "C:\Program Files\Java\jdk-11.0.2"

@Leomedina could you try

"java.home": "C:\\Program Files\\Java\\jdk-11.0.2"

@Leomedina
Copy link

@snjeza thanks for catching that. - that was on me. I pasted the wrong text.

My java.home is actually:

"java.home": "C:\\Program Files\\Java\\jdk-11.0.2"

@snjeza
Copy link
Contributor

snjeza commented Feb 9, 2019

Could you show the output of the following commands:

dir "C:\Program Files\Java\jdk-11.0.2"
dir "C:\Program Files\Java\jdk-11.0.2\bin"

@Leomedina
Copy link

Leomedina commented Feb 9, 2019

@snjeza Here's the output:

` Directory of C:\Program Files\Java\jdk-11.0.2

02/08/2019 03:47 PM

.
02/08/2019 03:47 PM ..
02/08/2019 03:47 PM bin
02/08/2019 03:47 PM conf
01/17/2019 09:41 PM 3,244 COPYRIGHT
02/08/2019 03:47 PM include
02/08/2019 03:47 PM jmods
02/08/2019 03:47 PM legal
02/08/2019 03:47 PM lib
02/08/2019 03:47 PM 160 README.html
02/08/2019 03:47 PM 1,285 release
3 File(s) 4,689 bytes
8 Dir(s) 192,377,327,616 bytes free

Directory of C:\Program Files\Java\jdk-11.0.2\bin

02/08/2019 03:47 PM

.
02/08/2019 03:47 PM ..
02/08/2019 03:47 PM 19,256 api-ms-win-core-console-l1-1-0.dll
02/08/2019 03:47 PM 18,744 api-ms-win-core-datetime-l1-1-0.dll
02/08/2019 03:47 PM 18,744 api-ms-win-core-debug-l1-1-0.dll
02/08/2019 03:47 PM 18,744 api-ms-win-core-errorhandling-l1-1-0.dll
02/08/2019 03:47 PM 22,328 api-ms-win-core-file-l1-1-0.dll
02/08/2019 03:47 PM 18,744 api-ms-win-core-file-l1-2-0.dll
02/08/2019 03:47 PM 18,744 api-ms-win-core-file-l2-1-0.dll
02/08/2019 03:47 PM 18,744 api-ms-win-core-handle-l1-1-0.dll
02/08/2019 03:47 PM 19,256 api-ms-win-core-heap-l1-1-0.dll
02/08/2019 03:47 PM 18,744 api-ms-win-core-interlocked-l1-1-0.dll
02/08/2019 03:47 PM 19,256 api-ms-win-core-libraryloader-l1-1-0.dll
02/08/2019 03:47 PM 21,304 api-ms-win-core-localization-l1-2-0.dll
02/08/2019 03:47 PM 19,256 api-ms-win-core-memory-l1-1-0.dll
02/08/2019 03:47 PM 18,744 api-ms-win-core-namedpipe-l1-1-0.dll
02/08/2019 03:47 PM 19,768 api-ms-win-core-processenvironment-l1-1-0.dll
02/08/2019 03:47 PM 20,792 api-ms-win-core-processthreads-l1-1-0.dll
02/08/2019 03:47 PM 19,256 api-ms-win-core-processthreads-l1-1-1.dll
02/08/2019 03:47 PM 18,232 api-ms-win-core-profile-l1-1-0.dll
02/08/2019 03:47 PM 19,256 api-ms-win-core-rtlsupport-l1-1-0.dll
02/08/2019 03:47 PM 18,744 api-ms-win-core-string-l1-1-0.dll
02/08/2019 03:47 PM 20,792 api-ms-win-core-synch-l1-1-0.dll
02/08/2019 03:47 PM 19,256 api-ms-win-core-synch-l1-2-0.dll
02/08/2019 03:47 PM 19,768 api-ms-win-core-sysinfo-l1-1-0.dll
02/08/2019 03:47 PM 18,744 api-ms-win-core-timezone-l1-1-0.dll
02/08/2019 03:47 PM 17,856 api-ms-win-core-util-l1-1-0.dll
02/08/2019 03:47 PM 19,768 api-ms-win-crt-conio-l1-1-0.dll
02/08/2019 03:47 PM 22,840 api-ms-win-crt-convert-l1-1-0.dll
02/08/2019 03:47 PM 19,256 api-ms-win-crt-environment-l1-1-0.dll
02/08/2019 03:47 PM 20,792 api-ms-win-crt-filesystem-l1-1-0.dll
02/08/2019 03:47 PM 19,768 api-ms-win-crt-heap-l1-1-0.dll
02/08/2019 03:47 PM 19,256 api-ms-win-crt-locale-l1-1-0.dll
02/08/2019 03:47 PM 27,064 api-ms-win-crt-math-l1-1-0.dll
02/08/2019 03:47 PM 26,936 api-ms-win-crt-multibyte-l1-1-0.dll
02/08/2019 03:47 PM 71,480 api-ms-win-crt-private-l1-1-0.dll
02/08/2019 03:47 PM 19,768 api-ms-win-crt-process-l1-1-0.dll
02/08/2019 03:47 PM 22,464 api-ms-win-crt-runtime-l1-1-0.dll
02/08/2019 03:47 PM 24,888 api-ms-win-crt-stdio-l1-1-0.dll
02/08/2019 03:47 PM 24,888 api-ms-win-crt-string-l1-1-0.dll
02/08/2019 03:47 PM 21,304 api-ms-win-crt-time-l1-1-0.dll
02/08/2019 03:47 PM 19,256 api-ms-win-crt-utility-l1-1-0.dll
02/08/2019 03:47 PM 25,960 attach.dll
02/08/2019 03:47 PM 1,546,088 awt.dll
02/08/2019 03:47 PM 33,640 dt_shmem.dll
02/08/2019 03:47 PM 30,568 dt_socket.dll
02/08/2019 03:47 PM 426,856 fontmanager.dll
02/08/2019 03:47 PM 517,480 freetype.dll
02/08/2019 03:47 PM 182,120 instrument.dll
02/08/2019 03:47 PM 46,440 j2gss.dll
02/08/2019 03:47 PM 22,888 j2pcsc.dll
02/08/2019 03:47 PM 67,944 j2pkcs11.dll
02/08/2019 03:47 PM 24,936 jaas.dll
02/08/2019 03:47 PM 41,832 jabswitch.exe
02/08/2019 03:47 PM 102,248 jaccessinspector.exe
02/08/2019 03:47 PM 65,896 jaccesswalker.exe
02/08/2019 03:47 PM 22,376 jaotc.exe
02/08/2019 03:47 PM 20,328 jar.exe
02/08/2019 03:47 PM 20,840 jarsigner.exe
02/08/2019 03:47 PM 154,472 java.dll
02/08/2019 03:47 PM 279,400 java.exe
02/08/2019 03:47 PM 148,840 javaaccessbridge.dll
02/08/2019 03:47 PM 20,840 javac.exe
02/08/2019 03:47 PM 20,840 javadoc.exe
02/08/2019 03:47 PM 174,952 javajpeg.dll
02/08/2019 03:47 PM 20,840 javap.exe
02/08/2019 03:47 PM 279,400 javaw.exe
02/08/2019 03:47 PM 18,280 jawt.dll
02/08/2019 03:47 PM 20,840 jcmd.exe
02/08/2019 03:47 PM 20,840 jconsole.exe
02/08/2019 03:47 PM 20,840 jdb.exe
02/08/2019 03:47 PM 20,840 jdeprscan.exe
02/08/2019 03:47 PM 20,840 jdeps.exe
02/08/2019 03:47 PM 213,352 jdwp.dll
02/08/2019 03:47 PM 20,840 jhsdb.exe
02/08/2019 03:47 PM 31,080 jimage.dll
02/08/2019 03:47 PM 20,840 jimage.exe
02/08/2019 03:47 PM 20,840 jinfo.exe
02/08/2019 03:47 PM 20,840 jjs.exe
02/08/2019 03:47 PM 246,632 jli.dll
02/08/2019 03:47 PM 20,840 jlink.exe
02/08/2019 03:47 PM 20,840 jmap.exe
02/08/2019 03:47 PM 20,840 jmod.exe
02/08/2019 03:47 PM 20,328 jps.exe
02/08/2019 03:47 PM 20,840 jrunscript.exe
02/08/2019 03:47 PM 20,840 jshell.exe
02/08/2019 03:47 PM 58,216 jsound.dll
02/08/2019 03:47 PM 20,840 jstack.exe
02/08/2019 03:47 PM 20,840 jstat.exe
02/08/2019 03:47 PM 20,840 jstatd.exe
02/08/2019 03:47 PM 20,840 keytool.exe
02/08/2019 03:47 PM 20,840 kinit.exe
02/08/2019 03:47 PM 20,840 klist.exe
02/08/2019 03:47 PM 20,840 ktab.exe
02/08/2019 03:47 PM 248,168 lcms.dll
02/08/2019 03:47 PM 20,328 le.dll
02/08/2019 03:47 PM 25,960 management.dll
02/08/2019 03:47 PM 21,352 management_agent.dll
02/08/2019 03:47 PM 32,616 management_ext.dll
02/08/2019 03:47 PM 508,264 mlib_image.dll
02/08/2019 03:47 PM 687,240 msvcp140.dll
02/08/2019 03:47 PM 91,496 net.dll
02/08/2019 03:47 PM 63,848 nio.dll
02/08/2019 03:47 PM 20,840 pack200.exe
02/08/2019 03:47 PM 21,864 prefs.dll
02/08/2019 03:47 PM 17,256 rmi.dll
02/08/2019 03:47 PM 20,840 rmic.exe
02/08/2019 03:47 PM 20,840 rmid.exe
02/08/2019 03:47 PM 20,840 rmiregistry.exe
02/08/2019 03:47 PM 34,152 saproc.dll
02/08/2019 03:47 PM 20,840 serialver.exe
02/08/2019 03:47 PM server
02/08/2019 03:47 PM 215,912 splashscreen.dll
02/08/2019 03:47 PM 148,840 sunec.dll
02/08/2019 03:47 PM 39,784 sunmscapi.dll
02/08/2019 03:47 PM 1,001,272 ucrtbase.dll
02/08/2019 03:47 PM 87,400 unpack.dll
02/08/2019 03:47 PM 138,600 unpack200.exe
02/08/2019 03:47 PM 89,752 vcruntime140.dll
02/08/2019 03:47 PM 56,168 verify.dll
02/08/2019 03:47 PM 28,520 w2k_lsa_auth.dll
02/08/2019 03:47 PM 166,248 windowsaccessbridge-64.dll
02/08/2019 03:47 PM 81,256 zip.dll
120 File(s) 10,116,848 bytes
3 Dir(s) 192,383,651,840 bytes free

C:\Users\medin>`

@snjeza
Copy link
Contributor

snjeza commented Feb 9, 2019

@Leomedina could you remove the georgewfraser.vscode-javac extension and install RedHat vscode-java - https://marketplace.visualstudio.com/items?itemName=redhat.java

@Leomedina
Copy link

@snjeza that fixed it! Thank you.

@alikrc
Copy link

alikrc commented Mar 15, 2019

like @snjeza answer, deleting george's extension worked for me, thanks man

@miggymiggoi
Copy link

* Open the command palette (F1)

* select Developer: Toggle Developer Tools

report any errors you see in the console

Uncaught (in promise) Error: Fetching local packages failed.
at l (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:902206)
at C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:902348
at Function.simpleDispatch (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:1172354)
at Emitter.emit (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:1173795)
at BufferedProcess.handleError (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:14:1033733)
at ChildProcess.process.on.e (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:14:1033676)
at emitOne (events.js:116:13)
at ChildProcess.emit (events.js:211:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
VM22 :11 Uncaught (in promise) Error: Fetching outdated packages and themes failed.
at l (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:902206)
at C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:902348
at Function.simpleDispatch (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:1172354)
at Emitter.emit (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:1173795)
at BufferedProcess.handleError (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:14:1033733)
at ChildProcess.process.on.e (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:14:1033676)
at emitOne (events.js:116:13)
at ChildProcess.emit (events.js:211:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
internal/process/warning.js:18 (node:9860) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
writeOut @ internal/process/warning.js:18
VM22 :14 Fetching local packages failed. Error: Fetching local packages failed.
at l (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:902206)
at C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:902348
at Function.simpleDispatch (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:1172354)
at Emitter.emit (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:1173795)
at BufferedProcess.handleError (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:14:1033733)
at ChildProcess.process.on.e (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:14:1033676)
at emitOne (events.js:116:13)
at ChildProcess.emit (events.js:211:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
(anonymous) @ VM22 :14
VM22 :11 Uncaught (in promise) Error: Fetching outdated packages and themes failed.
at l (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:902206)
at C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:902348
at Function.simpleDispatch (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:1172354)
at Emitter.emit (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:1173795)
at BufferedProcess.handleError (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:14:1033733)
at ChildProcess.process.on.e (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:14:1033676)
at emitOne (events.js:116:13)
at ChildProcess.emit (events.js:211:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
VM22 :14 Fetching local packages failed. Error: Fetching local packages failed.
at l (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:902206)
at C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:902348
at Function.simpleDispatch (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:1172354)
at Emitter.emit (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:1173795)
at BufferedProcess.handleError (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:14:1033733)
at ChildProcess.process.on.e (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:14:1033676)
at emitOne (events.js:116:13)
at ChildProcess.emit (events.js:211:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
(anonymous) @ VM22 :14
VM22 :11 Uncaught (in promise) Error: Fetching outdated packages and themes failed.
at l (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:902206)
at C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:902348
at Function.simpleDispatch (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:1172354)
at Emitter.emit (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:11:1173795)
at BufferedProcess.handleError (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:14:1033733)
at ChildProcess.process.on.e (C:\Users\Parallax\AppData\Local\atom\app-1.35.1\resources\app\static<embedded>:14:1033676)
at emitOne (events.js:116:13)
at ChildProcess.emit (events.js:211:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:196:12)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

@yaohaizh
Copy link
Collaborator

@miggymiggoi The errors you listed here are seems from atom, but not VSCode.

@johng42
Copy link

johng42 commented Jun 6, 2019

Side note: I was getting this error as well and triple checked everything above for env variables, etc...

The key for me was to launch VSCode as an admin. At that point, everything started working.

Frustrating because setup/install specifically recommended NOT running install as an admin.

Hope this helps.

@Rollins-MAKUWA
Copy link

thank you.

@manasbiparajuli
Copy link

thanks, @snjeza. Removing George's extension worked for me as well.

@quiles909
Copy link

Side note: I was getting this error as well and triple checked everything above for env variables, etc...

The key for me was to launch VSCode as an admin. At that point, everything started working.

Frustrating because setup/install specifically recommended NOT running install as an admin.
#785
Hope this helps.

I had the same issue here like everyone else, and opening VS Code as an Admin, the message about not starting java Language is no more. Not sure how else to run VS Code Java not as Admin and prevent the message from showing or how to fix it?

@quiles909
Copy link

@Leomedina could you remove the georgewfraser.vscode-javac extension and install RedHat vscode-java - https://marketplace.visualstudio.com/items?itemName=redhat.java

That worked, thanks!

@djkong7
Copy link

djkong7 commented Oct 2, 2020

I am having the same issue.

Brand new install of Windows 10.

JAVA_HOME: "C:\Program Files\AdoptOpenJDK\jdk-11.0.8.10-hotspot"

  1. Open the command palette (F1)
  2. select Developer: Toggle Developer Tools

[[object Object]]Internal error.

and

Error: Internal error.
at c:\Users\djkong7.vscode\extensions\redhat.java-0.68.0\dist\extension.js:1:76464
at c:\Users\djkong7.vscode\extensions\redhat.java-0.68.0\dist\extension.js:1:76758
at Immediate. (c:\Users\djkong7.vscode\extensions\redhat.java-0.68.0\dist\extension.js:1:77117)
at processImmediate (internal/timers.js:439:21)

These two errors are logged thousands of times.

I can't try "remove the georgewfraser.vscode-javac extension and install RedHat vscode-java -" because I've never had it installed.

Also tried to launch VSCode as admin. No luck.

Upon further searching, I found #1588 . Maybe someone here has some ideas.

@snjeza
Copy link
Contributor

snjeza commented Oct 2, 2020

@djkong7 Could you attach your settings.json?

@djkong7
Copy link

djkong7 commented Oct 2, 2020

@snjeza Yeah! Here you go.

{
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"terminal.integrated.shell.windows": "C:\Program Files\PowerShell\7\pwsh.exe",
"java.trace.server": "verbose",
"java.configuration.checkProjectSettingsExclusions": false
}

@snjeza
Copy link
Contributor

snjeza commented Oct 2, 2020

@djkong7 Could you try to add:

"java.home": "C:\\Program Files\\AdoptOpenJDK\\jdk-11.0.8.10-hotspot",

backslashes must be escaped (duplicated)

@djkong7
Copy link

djkong7 commented Oct 2, 2020

@snjeza Looks like I'm still having the same issue. New settings.json:

{
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
    "java.trace.server": "verbose",
    "java.configuration.checkProjectSettingsExclusions": false,
    "java.home": "C:\\Program Files\\AdoptOpenJDK\\jdk-11.0.8.10-hotspot"
}

same errors as before. Here is a screenshot of my Java Runtime Configuration.
image

@snjeza
Copy link
Contributor

snjeza commented Oct 2, 2020

Could you try to Clean the workspace directory ?

@djkong7
Copy link

djkong7 commented Oct 2, 2020

Same issue and same error messages after following the steps:

Open the command palette (F1)
select Java: Clean the Java language server workspace
click Restart and delete

@snjeza
Copy link
Contributor

snjeza commented Oct 2, 2020

@djkong7 could you attach your logs:
%APPDATA%\Code\User\workspaceStorage<your_workspace>\redhat.java - whole this directory

@djkong7
Copy link

djkong7 commented Oct 2, 2020

@snjeza So %APPDATA%\Code\User\workspaceStorage<your_workspace>\redhat.java is around 7.5GB. I backed up that folder and restarted VSCode to get a new folder that should hopefully have the same error logs in it, just much smaller.
redhat.java.zip

I was able to zip the original folder and get it down to 400MB. 15MB with 7zip if you'll accept that.

@snjeza
Copy link
Contributor

snjeza commented Oct 2, 2020

@djkong7 could you try to move your project to C:<some_directory> and try to open it?

@djkong7
Copy link

djkong7 commented Oct 2, 2020

@snjeza That seemed to work! Is running projects that reside in \\wsl$ something that is officially not supported?

@snjeza
Copy link
Contributor

snjeza commented Oct 2, 2020

@djkong7 you can try Remote development in WSL

@djkong7
Copy link

djkong7 commented Oct 2, 2020

@snjeza Ahh, gotcha. I guess it gets confusing when to use that or not since you can now browse WSL files natively in windows explorer. Thank you for your help!

@bhaskor-sarmah
Copy link

georgewfraser

Thanks buddy, this solved my issue also.

@anhLEvn
Copy link

anhLEvn commented Aug 8, 2021

@Leomedina could you remove the georgewfraser.vscode-javac extension and install RedHat vscode-java - https://marketplace.visualstudio.com/items?itemName=redhat.java

That worked, thanks!

@Leomedina could you remove the georgewfraser.vscode-javac extension and install RedHat vscode-java - https://marketplace.visualstudio.com/items?itemName=redhat.java

It worked. Great thanks!

@skorhone
Copy link

skorhone commented Oct 8, 2021

I had exactly the same problem that @djkong7 had. Project that I'm working on is located on WSL2, but I needed to run it on Windows (Firewall was blocking traffic from wsl2. wsl2 and workstation firewalls are just a big mess :-/)

There's a simple workaround for the problem where language server fails compiling source code from UNC paths ( \wsl$\foo = UNC path)

Open \\wsl$\ in File Explorer. Right click on the WSL2 installation and select Map network drive.... Finally open project from the mapped drive in VS Code.

@chehab2003
Copy link

Hello @snjeza I am facing the couldn’t start client java Language server do you know how to fix this?

@RamiSJ12
Copy link

@chehab2003
I just uninsstalled java enviroment aqnd extentions then install again and restart, will work properly, becaue now VSC has better API to dedct your bug.

@Hamzy-Ab
Copy link

Hamzy-Ab commented Nov 9, 2022

Side note: I was getting this error as well and triple checked everything above for env variables, etc...

The key for me was to launch VSCode as an admin. At that point, everything started working.

Frustrating because setup/install specifically recommended NOT running install as an admin.

Hope this helps.

Worked like magic. Thanks man.

@mohdfurkan01
Copy link

When I open a java project in VSCode and click on a .java file, I get the error - "Couldn't start client Java Language Server".
I am facing the same problem what can I do?

@Hamzy-Ab
Copy link

Hamzy-Ab commented Feb 8, 2023 via email

@RokE03
Copy link

RokE03 commented Mar 9, 2023

I happened to solve my instance of this issue by editing the settings.json:

I found following:
"java.jdt.ls.java.home": ",

After adding my openjdk-directory on this parameter, the error didn't show up anymore.

@mohdfurkan01
Copy link

I happened to solve my instance of this issue by editing the settings.json:

I found following: "java.jdt.ls.java.home": ",

After adding my openjdk-directory on this parameter, the error didn't show up anymore.

ok I will check it....and thanks for the help & support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests