vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

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

Open atang0404 opened this issue 10 years ago • 61 comments

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 avatar Sep 27 '16 03:09 atang0404

Also.... java_props

atang0404 avatar Sep 27 '16 04:09 atang0404

Can you try with java home not containing spaces?

fbricon avatar Sep 27 '16 05:09 fbricon

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 avatar Sep 29 '16 12:09 linonetwo

I have set

JAVA_HOME C:\Java\jre1.8.0_102

JDK_HOME C:\Java\jdk1.8.0_102

still not working

linonetwo avatar Sep 29 '16 13:09 linonetwo

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.

fbricon avatar Sep 29 '16 13:09 fbricon

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

↙ Like this one.

linonetwo avatar Sep 29 '16 13:09 linonetwo

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

ghost avatar Oct 02 '16 02:10 ghost

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?

vabatta avatar Oct 11 '16 12:10 vabatta

@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

fbricon avatar Oct 11 '16 12:10 fbricon

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

maxtar avatar Oct 11 '16 12:10 maxtar

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

fbricon avatar Oct 11 '16 13:10 fbricon

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

vabatta avatar Oct 11 '16 13:10 vabatta

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.

fbricon avatar Oct 11 '16 13:10 fbricon

@fbricon Thanx, waiting. :)

maxtar avatar Oct 11 '16 14:10 maxtar

@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 avatar Oct 11 '16 17:10 vabatta

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 😋

vabatta avatar Oct 11 '16 17:10 vabatta

@vabatta It only support maven now AFAIK

linonetwo avatar Oct 12 '16 01:10 linonetwo

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

fbricon avatar Oct 12 '16 01:10 fbricon

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

linonetwo avatar Oct 12 '16 01:10 linonetwo

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

gorkem avatar Oct 13 '16 22:10 gorkem