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

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

Closed
atang0404 opened this issue Sep 27, 2016 · 61 comments

Comments

@atang0404
Copy link

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

@atang0404
Copy link
Author

Also....
java_props

@fbricon
Copy link
Collaborator

fbricon commented Sep 27, 2016

Can you try with java home not containing spaces?

@linonetwo
Copy link

I tried C:\Progra~1\Java\jdk1.8.0_91 but it still warns The JAVA_HOME environment variable could not be detected, or it doesn't point to a JDK.

@linonetwo
Copy link

linonetwo commented Sep 29, 2016

I have set

JAVA_HOME C:\Java\jre1.8.0_102

JDK_HOME C:\Java\jdk1.8.0_102

still not working

@fbricon
Copy link
Collaborator

fbricon commented Sep 29, 2016

JAVA_HOME pointing to a JRE will certainly not work. It has to be a JDK. JDK_HOME is not supported.
I'll have to try it on Windows to see what's happening.

@linonetwo
Copy link

It's OK if I set JAVA_HOME to C:\Java\jdk1.8.0_102, but there is a downside thumbnail.

↙ Like this one.

@ghost
Copy link

ghost commented Oct 2, 2016

I'm no expert nor am I the best when it comes to coding but I believe the downside thumbnail indicates no maven hierarchy. I set my JAVA_HOME to the JDK and all my errors disappeared but now I'm stuck with the downside thumbnail. @linonetwo Other tickets have stressed the extension doesn't support Java files without the hierarchy.

If I use Eclipse to initially compile my Java files will that work? @fbricon

@vabatta
Copy link

vabatta commented Oct 11, 2016

I also have the same problem, after setting the JAVA_HOME I got the thumb down (which implies that some features won't work right?). Do actually need some other sort of file to get it working (like a build.xml or some other IDE-Java file related, think of maven) in the project folder?

@fbricon
Copy link
Collaborator

fbricon commented Oct 11, 2016

@vabatta you need:

  • a JAVA_HOME env variable pointing to a JDK (not JRE) home directory
  • to open a folder containing a Maven pom.xml ideally. Eclipse .project/.classpath settings are somehow supported, to a lesser degree. So for instance, if you have a gradle project, you can try to generate the eclipse settings before opening the project.

In case it doesn't work, click on the thumb down icon to access some logs

@maxtar
Copy link

maxtar commented Oct 11, 2016

I have the same. But is it extension can open only maven project? What about just java files?

@fbricon
Copy link
Collaborator

fbricon commented Oct 11, 2016

@maxtar we're working on it (#27). Problem is standalone java files provide no context, no classpath. Displaying tons of compilation errors would be detrimental in that case. We're looking into providing a minimal content assist for basic Java apis in that case.

@vabatta
Copy link

vabatta commented Oct 11, 2016

@fbricon so we actually should use a maven or eclipse base project to get it working right?
My JAVA_HOME is pointing to ~/.jenv/versions/1.8.0.102 which actually is the complete folder to JDK managed through jenv CLI command.

@fbricon
Copy link
Collaborator

fbricon commented Oct 11, 2016

I know I fixed the case when JAVA_HOME was not resolving paths starting with ~ recently (#28). Until the release later this week, can you try using an absolute path for JAVA_HOME?

And yes you currently need a Maven or Eclipse based project for the extension to be able to infer the project classpath. This requirement is stated in the extension description/README.

@maxtar
Copy link

maxtar commented Oct 11, 2016

@fbricon Thanx, waiting. :)

@vabatta
Copy link

vabatta commented Oct 11, 2016

@fbricon it's actually an absolute path, just used the ~ as shortcut, but I use it as /Users/vabatta/....
So, I probably need the Maven or Eclipse files to get the ext working (actually, I just opened the folder which contains only 3 Java files).

@vabatta
Copy link

vabatta commented Oct 11, 2016

So there won't be support to just Java files? I was using VS Code instead of a IDE solution due to have just some simple but complete autocomplete and syntax highlighting... I don't want to use a full-super-steroids-crappy-IDE, though it would do all as I don't want actually to install an App just for some easy Java homework 😋

@linonetwo
Copy link

@vabatta It only support maven now AFAIK

@fbricon
Copy link
Collaborator

fbricon commented Oct 12, 2016

@vabatta we're working on standalone java file support (#27)

@linonetwo
Copy link

@fbricon I think it's fine, though. Since in javascript world, we heavily rely on ESLint , which will only support full working directory opening, and don't work properly when opening single js file.

I just want some Gradle support.... Since react-native use Gradle instead of maven...

@gorkem
Copy link
Contributor

gorkem commented Oct 13, 2016

@atang0404 Can you check the new 0.0.5 release if you have the same problem? Also please note that we have a new setting java.home to point to a Java SDK without the need for JAVA_HOME environment variable that may be interesting for you.

@fernandocangussu
Copy link

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

@gorkem
Copy link
Contributor

gorkem commented Nov 1, 2016

@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.

@fernandocangussu
Copy link

Nothing here. I updated vscode and the extension, but the problem continues.

@DanJ210
Copy link

DanJ210 commented Nov 7, 2016

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...

@YuvaAthur
Copy link

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

@gorkem
Copy link
Contributor

gorkem commented Nov 16, 2016

@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.

@jamesskyoung
Copy link

jamesskyoung commented Nov 21, 2016

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.

@YuvaAthur
Copy link

@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.)

@gorkem
Copy link
Contributor

gorkem commented Nov 21, 2016

@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.

@ryanstinson
Copy link

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?

@ryanstinson
Copy link

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.

@ryanstinson
Copy link

@kohlschuetter any ideas?

@kamtungc
Copy link

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?

@ryanstinson
Copy link

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.

@kamtungc
Copy link

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.

@bluejekyll
Copy link

bluejekyll commented Apr 11, 2017

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.

@newxpp
Copy link

newxpp commented Apr 24, 2017

can't run java!
C:\Program Files (x86)\Java\jdk1.8.0_101

java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) Client VM (build 25.101-b13, mixed mode, sharing)

@fbricon
Copy link
Collaborator

fbricon commented Apr 24, 2017

@newxpp can you please enable logging so we can understand why the client fails to start?

@limey-git
Copy link

limey-git commented May 5, 2017

TL;DRDownload the junixsocket-parent-2.0.4 source, then build with maven.

I'm running a 32bit Ubuntu 12.04 guest on a VirtualBox VM. JDK 1.8.0_131-b11.

After downloading the VS Code version 1.12.0 yesterday, I got that same "Library 'libjunixsocket-native-2.0.4.so' not found!" error others reported.

My Ubuntu 12.04 VM is 32bit. The 'libjunixsocket-native-2.0.4.so' library that Microsoft distributes with the 32 bit version of Code 1.12.0, was built for a 64bit machine!

What fixed it for me, was this...

  • Backup all the jars in '[your.home.dir]/.vscode/extensions/redhat.java-0.3.0/server/config_linux/org.eclipse.osgi/45/0/.cp/lib'

  • Download the junixsocket-parent-2.0.4 source from here, then untar it to wherever

  • cd to the parent project [junixsocket-junixsocket-parent-2.0.4]

  • Build with 'mvn package' [you might have to cd into junixsocket-native-common and junixsocket-native if they're not built by the parent]

  • Combine the contents of the following jars and folders into one single jar — then name that newly-created jar 'junixsocket-native-common-2.0.4.jar' [I stitched mine together manually. But you could probably hack the pom and have maven do it for you]

junixsocket-junixsocket-parent-2.0.4/junixsocket-native-common/target/META-INF
junixsocket-junixsocket-parent-2.0.4/junixsocket-native-common/target/junixsocket-native-common-2.0.4.jar
junixsocket-junixsocket-parent-2.0.4/junixsocket-native/target/META-INF
junixsocket-junixsocket-parent-2.0.4/junixsocket-native/target/junixsocket-native-2.0.4.jar
junixsocket-junixsocket-parent-2.0.4/junixsocket-native/target/nar/junixsocket-native-2.0.4-i386-Linux-gpp-jni/lib

Don't forget to include the MANIFEST.MF file.

This is what my merged 'junixsocket-native-common-2.0.4.jar' file contains...

lib/
lib/i386-Linux-gpp/
lib/i386-Linux-gpp/jni/
lib/i386-Linux-gpp/jni/history.xml
lib/i386-Linux-gpp/jni/libjunixsocket-native-2.0.4.so
META-INF/MANIFEST.MF
META-INF/maven/
META-INF/maven/com.kohlschutter.junixsocket/
META-INF/maven/com.kohlschutter.junixsocket/junixsocket-native/
META-INF/maven/com.kohlschutter.junixsocket/junixsocket-native-common/
META-INF/maven/com.kohlschutter.junixsocket/junixsocket-native-common/pom.properties
META-INF/maven/com.kohlschutter.junixsocket/junixsocket-native-common/pom.xml
META-INF/maven/com.kohlschutter.junixsocket/junixsocket-native/pom.properties
META-INF/maven/com.kohlschutter.junixsocket/junixsocket-native/pom.xml
META-INF/nar/
META-INF/nar/com.kohlschutter.junixsocket/
META-INF/nar/com.kohlschutter.junixsocket/junixsocket-native/
META-INF/nar/com.kohlschutter.junixsocket/junixsocket-native/nar.properties
org/
org/newsclub/
org/newsclub/net/
org/newsclub/net/jni/
org/newsclub/net/jni/DummyClass.class
org/newsclub/net/unix/
org/newsclub/net/unix/NarSystem.class
  • replace '[your.home.dir]/.vscode/extensions/redhat.java-0.3.0/server/config_linux/org.eclipse.osgi/45/0/.cp/lib/junixsocket-native-common-2.0.4.jar' with the one you just built from the contents of all those other things.

  • replace '[your.home.dir]/.vscode/extensions/redhat.java-0.3.0/server/config_linux/org.eclipse.osgi/45/0/.cp/lib/junixsocket-common-2.0.4.jar' with the one you built with maven '[junixsocket-junixsocket-parent-2.0.4/junixsocket-common/target/junixsocket-common-2.0.4.jar]'

Phewwww! What a faff just to install an IDE! That says a lot about Microsoft's commitment to *nix support. Ay?

@fbricon
Copy link
Collaborator

fbricon commented May 5, 2017

Discussion about 32bits junixsocket moved to #201

@igor-kudryashov
Copy link

igor-kudryashov commented May 16, 2017

I just installed VSCode v. 1.12.2 and "Language Support for Java(TM) by Red Hat" plugin v. 0.4.0. I have the same error "Couldn't start client Language Support for Java". I set up java.home parameter in VSCode. This does not solve the problem. I set up JAVA_HOME Windows variable to same folder. This does not solve the problem, too. I deleted java.home setting from VSCode. And here's a miracle! Everything worked. So, we have a problem with incorrect work java.home inside plugin.

@fbricon
Copy link
Collaborator

fbricon commented May 16, 2017

@igor-kudryashov can you please enable logging so we can understand what's happening?

@igor-kudryashov
Copy link

@fbricon I'm sorry, I can not repeat this error. I guess I did something wrong before.

@simonl65
Copy link

simonl65 commented Jun 2, 2017

I eventually got this working in Windows with the following in vscode:

"java.home": '"C:\Program Files\Java\jdk1.8.0_131"'

NOTES:

  1. Double back-slashes
  2. Single quotes around the double-quotes (because the path has spaces).

HTH

@cwainner
Copy link

cwainner commented Aug 3, 2017

I recently started having this problem as well on Ubuntu. This is the Java error that I get from the error log:

!ENTRY org.eclipse.osgi 4 0 2017-08-03 16:43:44.686
!MESSAGE Application error
!STACK 1
org.eclipse.core.runtime.CoreException: Plug-in org.eclipse.jdt.ls.core was unable to load class org.eclipse.jdt.ls.core.internal.LanguageServer.
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:191)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.jdt.ls.core (47).
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:112)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:368)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:446)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:564)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
	... 16 more
Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.start() of bundle org.eclipse.jdt.ls.core.
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:800)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:729)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:933)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:309)
	at org.eclipse.osgi.container.Module.doStart(Module.java:581)
	at org.eclipse.osgi.container.Module.start(Module.java:449)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:468)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:103)
	... 26 more
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jdt/core/JavaCore
	at org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager.initialize(PreferenceManager.java:52)
	at org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager.<init>(PreferenceManager.java:43)
	at org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.start(JavaLanguageServerPlugin.java:101)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:779)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:772)
	... 33 more

I double check my jdk installation and that seems to be correct. I've also tried the JAVA_HOME fix, but looking at the above error I think it might be something different. I should also note that I did recently update my jdk to 1.8.0_131, so maybe that might have borked something?

@fbricon
Copy link
Collaborator

fbricon commented Aug 4, 2017

That kind of NoClassDefFoundError is typical of OSGi bundle failing to load. Possibly, your workspace got borked. I suggest cleaning it up and trying again

@cwainner
Copy link

cwainner commented Aug 4, 2017

@fbricon That did the trick. Thank you!

@feRpump
Copy link

feRpump commented Aug 15, 2017

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
Copy link
Contributor

gorkem commented Aug 15, 2017

@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
Copy link

feRpump commented Aug 15, 2017

@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
Copy link
Contributor

gorkem commented Aug 15, 2017

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
Copy link

feRpump commented Aug 15, 2017

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
Copy link

chilloutman commented Aug 18, 2017

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
Copy link

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
Copy link

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

ansyral pushed a commit to ansyral/vscode-java that referenced this issue Oct 11, 2017
* periodically query usage data

* add back license

* increase usage data query interval to 60s

* query usage data when terminating debug session
@rgrunber
Copy link
Member

rgrunber commented Feb 2, 2022

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.

@rgrunber rgrunber closed this as completed Feb 2, 2022
@ai-chen2050
Copy link

image

There are two issues:

  • one is tip says: Missing Gradle project configuration file: .settings/org.eclipse.buildship.core.prefs, cos I touch a file org.eclipse.buildship.core.prefs, and added the "org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore" to file. but it doesn't work at all.
  • two issue is : Access restriction: The type 'OperatingSystemMXBean' is not API (restriction on required library '/Library/Java/JavaVirtualMachines/jdk1.8.0_202.jdk/Contents/Home/jre/lib/rt.jar')
  • env:
    - apple m1 pro
    - latest java pack
    - use Oracle JDK 1.8 to run the program, and use OpenJDK 17 to jdt, as the java server.
  • Help! It's been bothering me all day. @fbricon @snjeza @lfarkas

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