redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.08k stars 442 forks source link

Language Support for Java(TM) by Red Hat - Couldn't start client Language Support for Java #45

Closed atang0404 closed 2 years ago

atang0404 commented 8 years ago

Hi guys:

I just recently installed the Language Support for Java extension however, I can't seem to get it working. Whenever I open a Java file I get a message stating the it "Couldn't start client Language Support for Java".

I get an error output that reads:

[Error - 11:54:37 PM] Starting client failed 13

I've already checked to see if JAVA_HOME is mapped under Environment Variables and it has. Any help would be appreciated. Thanks! Alexander Tang

cwainner commented 7 years ago

@fbricon That did the trick. Thank you!

feRpump commented 7 years ago

I'm facing the same issue, Starting client failed, and i tried to fix like @simonl65 did, but with no luck on that. Any help here?

SO: Windows 10 64bits, my jdk is here -> C:\Program Files\Java\jdk1.8.0_131, when run "javac" on cmd it works fine.

gorkem commented 7 years ago

@feRpump Can you retrieve the server logs? Also can you check your .settings for any java related values? Troubleshooting section on wiki can help you locate the logs.

feRpump commented 7 years ago

@gorkem Here we go. The error in log says: [Extension Host] rejected promise not handled within 1 second t.logExtensionHostMessage @ /C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:29 /C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:29 The java.home variable defined in VS Code settings points to a missing folder e.onUnexpectedError @ /C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:29 I think my settings are these: // Place your settings in this file to overwrite the default settings { "editor.fontFamily": "Fira Code", "editor.fontSize": 16, "editor.fontLigatures": true, "workbench.colorTheme": "Panda Syntax", "java.home": '"C:\Program Files\Java\jdk1.8.0_131"' } Please, correct me if i'm wrong!

gorkem commented 7 years ago

It looks like it does not like the java.home settings The java.home variable defined in VS Code settings points to a missing folder. Can you check what happens if you remove the java.home from settings

feRpump commented 7 years ago

Well, looks like the error is gone now... I tried this before but with no luck. So, can I compile standalone java files ? Like using javac ? If is, how can I do so?

chilloutman commented 7 years ago

The Extension Host logs this for me:

[Extension Host] Executing /Library/Java/Home/bin/java -Declipse.application=org.eclipse.jdt.ls.core.id1 -Dosgi.bundles.defaultStartLevel=4 -Declipse.product=org.eclipse.jdt.ls.core.product -noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication -jar /Users/ln/.vscode/extensions/redhat.java-0.8.0/server/plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar -configuration /Users/ln/.vscode/extensions/redhat.java-0.8.0/server/config_mac -data /Users/ln/Library/Application Support/Code/User/workspaceStorage/0b093bbdf7d9c58c81e4cc08cf217a58/redhat.java/jdt_ws

(One thing that caught my eye is that the Application Support path is not quoted. Maybe it's only like that in the log output though.)

If I run that command manually, I get the same exit code 13 and no log output.

I deleted the directory specified as -data and it now launches again.

rm -rf '/Users/ln/Library/Application Support/Code/User/workspaceStorage/0b093bbdf7d9c58c81e4cc08cf217a58/redhat.java/jdt_ws'

java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
zzyykk123456 commented 7 years ago

In windows 10,I edit the file setting.json in C:\Users\adminstrator\AppData\Roaming\Code\User,and it did work.The content from { "workbench.colorTheme": "Monokai Dimmed", "window.zoomLevel": 0, "window.menuBarVisibility": "default", "workbench.activityBar.visible": true, "workbench.sideBar.location": "left" } to { "workbench.colorTheme": "Monokai Dimmed", "window.zoomLevel": 0, "window.menuBarVisibility": "default", "workbench.activityBar.visible": true, "java.home": "C:\Program Files\Java\jdk1.8.0_144", "workbench.sideBar.location": "left" }

chilloutman commented 7 years ago

If you're not getting error code 13-visible in the VS Code Console-your problem is a different one.

rgrunber commented 2 years ago

I'm closing this since most of the issues seemed resolved, and because since vscode-java 1.2.0, we provide an embedded Java runtime for many popular platforms.

ai-chen2050 commented 2 years ago
image

There are two issues: