question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Language Support for Java(TM) by Red Hat - org.eclipse.jdt.ls.core Initialization failed Path for project must have only one segment.

See original GitHub issue

Hello everybody,

I get the following error when I try to open a folder project in VScode. !ENTRY org.eclipse.jdt.ls.core 4 0 2019-05-15 14:52:12.232 !MESSAGE Initialization failed !STACK 0 java.lang.IllegalArgumentException: Path for project must have only one segment. at org.eclipse.core.runtime.Assert.isLegal(Assert.java:66) at org.eclipse.core.internal.resources.WorkspaceRoot.getProject(WorkspaceRoot.java:150) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.create(ProjectConfigurationManager.java:980) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$1.call(ProjectConfigurationManager.java:162) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$1.call(ProjectConfigurationManager.java:1) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99) at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1336) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.importProjects(ProjectConfigurationManager.java:143) at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.importProjects(ProjectConfigurationManager.java:133) at org.eclipse.jdt.ls.core.internal.managers.MavenProjectImporter.importToWorkspace(MavenProjectImporter.java:188) at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:147) at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:137) at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:245) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

This is a problem for me because I cannot see, for example, if I forgot to put an import for a specific class. Anyway, I notated a strange behavior during extension using. I have some projects the extensions wors well in, some others the extension doesn’t work getting the above error. I’ve already tried to delete and re-install VScode and the extension, but the result is the same.

Attached I put my pom.xml and my logs. Language Support Java.log

pom.xml.txt

Thanks for your support. Simone

Environment
  • Operating System: Windows 10
  • JDK version: 1.8.0_144
  • Visual Studio Code version: 1.33.1
  • Java extension version: 0.44.0
Steps To Reproduce
  1. Try to build a project with attached pom.xml
  2. See if the Language Support for Java is correctly initialized
  3. Then, try to type a new class (for example … = new JSONObject(…))
  4. See if VScode checks the class import existing.

[attach a sample project reproducing the error] attach logs

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
nicolasheftycommented, Aug 29, 2019

I think that the artifactId value is not being resolved. I had the same issue. Tried replacing: < artifactId>${applicationName}</ artifactId> With: < artifactId>abc</ artifactId>

And the problem solved for me. This is just a work around, since in the command line the pom.xml works as is (in my case).

Source: https://stackoverflow.com/questions/13197092/how-can-i-fix-path-for-project-must-have-only-one-segment-error-when-creating

0reactions
simo385commented, Sep 6, 2019

Dear all,

I solved the problem. I had to put the following configuration in pom.xml <groupId>world.dedicated</groupId> <artifactId>DMP_Watchdog</artifactId> <version>0.0.1</version> <packaging>jar</packaging>

instead of: <groupId>world.dedicated</groupId> <artifactId>${applicationName}</artifactId> <version>${appVersion}</version> <packaging>jar</packaging>

Thanks for your support Simone

Read more comments on GitHub >

github_iconTop Results From Across the Web

Language Support for Java(TM) by Red Hat
Absolute path to JDK home folder used to launch the Java Language Server. Requires VS Code restart. java.jdt.ls.lombokSupport.enabled : Whether to enable lombok ......
Read more >
redhat-developer/vscode-java - Gitter
I can run program this moment. suddenly,the output shows: The workspace will exit with unsaved changes in this session. Connection to server got...
Read more >
End-user Guide Red Hat CodeReady Workspaces 2.0
When there is a need for a workspace to fix an old maintenance branch, the project devfile ... Projects of the workspace (path,...
Read more >
Known Issues for JDK 8 - Oracle
This section describes known issues in this release. Issues from the previous release that have been resolved in this release are also identified....
Read more >
Red Hat Developer Toolset 3.x User Guide - Linux @ CERN
1. Red Hat Developer Toolset can be used on multiple major and minor releases of Red Hat. Enterprise Linux, as detailed in Section...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found