Language Support for Java(TM) by Red Hat - Couldn't start client Language Support for Java
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
I'm with the same problem of @atang0404. But i'm using linux mint. I did set JAVA_HOME both ways, on linux and on vscode, but it doesn't work. [Error - 21:43:35] Starting client failed 13
@atang0404 @fernandocangussu can you try the new 0.0.6 release. I only had a fedora to test but I think your issue may be resolved now.
Nothing here. I updated vscode and the extension, but the problem continues.
I'm somewhat new to this and learning. Would anyone be kind enough to briefly explain how I get to the JAVA_HOME part to add my install path of the JDK? I can create a launch.json file but it gives me several choices and I'm not sure which I'm supposed to be choosing. Any help for a beginner would be much appreciated. I am currently a programming student but I've never had to set things up like this before. I have gotten some working like PHP, C#, JavaScript... This ones proving difficult! In the end, I am trying to open a .java file by itself so I know that it shouldn't work, I'm only trying to get up to speed on the JAVA_HOME. Thanks in advance.
Oh and I do have eclipse projects that I have made from a Java class so if I could figure out the JAVA_HOME thing, then I should be able to debug those eclipse projects...
Hi, I picked up the output of /usr/libexec/java_home and set "java.home": "/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home" in javaconfig.json setting.json
Still I get the error that java.home is not set right.
I have tried: a) uninstalling and reinstalling Java Extension b) several restarts of VS Code c) I keep getting thums down with no log :(! d) Java server is not able to start on the client. I have no clue how to fix it after searching for solutions on the web.
Environment: Mac OS X 10.11.6 | VS Code 1.7.1 | RedHat extension downloaded and applied on Nov 15th.
For the solution, I want clear instructions and samples - I find documentation rather hard to follow since there are very few examples on how the changes look in a real system.
Thanks for this! I enjoy working with VS Code and so would like to use for Java projects too.
Regards, Yuva
@YuvaAthur thumbsdown usually means that your server is working but your project can not be recognized. Are you using a maven based project? The currently released version only supports maven.
We are aware that we are thin on documentation at the moment. We have started to write some, it is very early work but may help.
Quite like VSCode... installed it for my NodeJS projects -- and quite impressed. Works very well including the NodeJS debugging. Thought I'd try it out for Java.
It works.. but need to be able to define a build path a la Eclipse etc... We don't use Maven ... Doesn't look like that is supported? So looks like I'm stuck with Eclipse.. not a bad thing.. just prefer the Editor and speed of VSCode.
@gorkem - Thanks! I created a maven project in Eclipse and used it in VS Code. I got a ThumbsUp! Yay!
Now, eclipse has a simple pom.xml and a detailed pom.xml that is generated on the fly. What level of detail does VS Code Java project expect?
(BTW, the project is not compiling in eclipse - there are other issues to fix. I am working on it. Once I can get the project to compile, I shall test it in VS Code.)
@YuvaAthur You do not need to have anything special on pom.xml for this extension. If you have a thumbs up that means the extension is able to recognize your project.
Ubuntu 14.04 Version 1.9.1 Commit f9d0c687ff2ea7aabd85fb9a43129117c0ecf519 Date 2017-02-08T23:29:12.221Z Shell 1.4.6 Renderer 53.0.2785.143 Node 6.5.0
I am getting error after "Completing Java Installation" Error occurs "Couldn't start client Language Support for Java". The config_linux directory includes a log with exception:
!SESSION 2017-02-13 09:23:33.173 ----------------------------------------------- eclipse.buildId=unknown java.version=1.8.0_121 java.vendor=Oracle Corporation BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US Command-line arguments: -data /home/ryanstinson/.config/Code/User/workspaceStorage/bc293bac07e5fda7793c38d73e44e662/redhat.java/jdt_ws
!ENTRY org.eclipse.osgi 4 0 2017-02-13 09:23:34.216
!MESSAGE Application error
!STACK 1
java.lang.ExceptionInInitializerError
at org.newsclub.net.unix.AFUNIXSocket.
Seems you need to install the native JNI libraries 1st. https://code.google.com/archive/p/junixsocket/wikis/GettingStarted.wiki.
For me, it works OOTB on ubuntu 16.10
Thanks @fbricon - It seems the libs at that link are 1.x and the extension is looking for 2.0.4.
I don't see anyway to get the "libjunixsocket-native-2.0.4.so" it is looking for. Any help would be greatly appreciated.
I don't know the answer to that, maybe @kohlschuetter can help?
I was able to get the lib installed from maven repo. ldconfig shows the lib:
libjunixsocket-native-2.0.4.so (libc6,x86-64) => /usr/lib/libjunixsocket-native-2.0.4.so
But still the same error persists. Any help at this point?
After digging a bit more, I found that the junix jar files are installed along side the org.eclipse.osgi libs. So, for whatever reason, the 'native-lib-loader' package cannot load the jar file and its embedded libjunixsocket-native-2.0.4.so library.
@kohlschuetter any ideas?
I got the "Couldn't start client Language Support for Java" error on my Windows OS. I've followed all the steps in this discussion.
In Visual Studio Code "java.home": "C:\Progra~1\Java\jdk1.8.0_121" OR "java.home": "C:\Program Files\Java\jdk1.8.0_121"
In System: JAVA_HOME=C:\Program Files\Java\jdk1.8.0_121
I am using Visual Studio Code in Windows 10 partition on my Mac Pro machine.
Is there any debug log from this extension to check what the actual problem is?
In the vs code extension directory "%USERPROFILE%.vscode\extensions" on windows, navigate to the red hat plugin/config_windows/server directory. Within that directory will be any logs associated with starting the plugin.
I have .vscode\extensions\redhat.java-0.0.10\server\config_win\config.ini only.
And, finally, I found the issue. It looks like the extension could not start correctly because of "java.jdt.ls.vmargs". "lombok.jar" is not correct. Now I can start the extension! Thanks!
"java.home": "c:\\Program Files\\Java\\jdk1.8.0_121",
"java.jdt.ls.vmargs": "-javaagent:C:\\codes\\libs\\java\\lombok.jar -Xbootclasspath/a:C:\\codes\\libs\\java\\lombok.jar"
I just followed https://github.com/redhat-developer/vscode-java/wiki/Lombok-support to add lombok.jar.
I'm also experiencing the libjunixsocket-native-2.0.4.so issue. I extracted the .so from the jar, checked dependencies:
$ ldd libjunixsocket-native-2.0.4.so
linux-vdso.so.1 => (0x00007ffd1b4ce000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fc34d71d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc34d417000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fc34d201000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc34ce39000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc34dc25000)
All of those exist on the system. In my case the specific error is a little different:
Caused by: java.lang.UnsatisfiedLinkError: /tmp/libjunixsocket-native-2.0.42440132215440112994.so: /tmp/libjunixsocket-native-2.0.42440132215440112994.so: failed to map segment from shared object: Operation not permitted
This is on an older version of ubuntu 14.04 (reasons...). My thought is there there may be reasons that the .so can't be loaded out of /tmp/ due to some mount restrictions on /tmp. I can't exec a shell script in /tmp for example. It's not mounted noexec though:
$ mount
...
/tmp on /var/tmp type none (rw,bind)
Any thoughts?
UPDATE: This did turn out to be a mount issue. I have a bind mount point for tmp, and the original mount point was noexec, removing that from fstab fixes the issue. I did look for an alternate way to change the tmp dir, but that wasn't obvious.