Vscode-java: Failed to initialize the extension for the first run

Created on 5 Oct 2016  路  9Comments  路  Source: redhat-developer/vscode-java

When I first install the Java extension, and create a java file, the initialize started, but always failed with below messages:

[Error - 08:42:42] 2016-10-5 8:42:42 An internal error occurred during: "Initialize Workspace".
null
java.lang.NullPointerException
    at java.io.File.<init>(File.java:277)
    at org.jboss.tools.vscode.java.internal.managers.ProjectsManager.createProject(ProjectsManager.java:46)
    at org.jboss.tools.vscode.java.internal.handlers.InitHandler$1.run(InitHandler.java:85)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

[Error - 08:42:42] Request textDocument/codeLens failed.
  Message: undefined
  Code: -32603 

how to solve this problem?

need info

Most helpful comment

@C-F-4 I guess you can keep a hello world maven project for practicing. In the meanwhile @fbricon has been prototyping with supporting single .java files but it needs to be matured before we can release.

All 9 comments

Extension supports only projects with a Maven pom.xml or basic Eclipse Java (JDT) projects.
I suspect your project does not have any of these. Can you verify?

This is probably a variation of #38.

In that case, as @gorkem said, you can't create a new java-type file without having opened a maven-based folder first

So there is no support of auto-completion or code-formatting for a java file then?

Depends on the Java file. If you are referring to a .java file that sits somewhere on a directory that does not provide any other artifacts that would allow us to recognize the project structure, we do not support it at the moment. Otherwise we do support code completion and formatting for .java files that we can recognize structure for.

@C-F-4 what is your case ? How is your file build?

A fix will be released today for this particular error, but code completion/compilation errors will not be supported. I.e the fix prevents the error but the extension will do provide nothing more than syntax coloring for standalone java files.

@gorkem I use Netbeans IDE for java projects unless I am practicing for my DS/ Algorithms etc(single .java files usually) then I prefer VS Code Notepad++ etc, since it's way faster! So that's why I installed the extension! But guess it doesn't have any support for that yet.

@C-F-4 I guess you can keep a hello world maven project for practicing. In the meanwhile @fbricon has been prototyping with supporting single .java files but it needs to be matured before we can release.

Can't wait for the release! :bowtie:

Standalone java file support will be coming in the next release. Please follow up on https://github.com/redhat-developer/vscode-java/issues/27.

As for the original error, I believe this is fixed in the new 0.0.6 release. Can you please confirm?

Was this page helpful?
0 / 5 - 0 ratings