Error: Path for project must have only one segment
Even Though google shows 995,000 pages containg the text “Path for project must have only one segment” – None of them really explains what this error mean – Except if you look at the source code of WorkspaceRoot class, particularly ‘getProject’ method:
This problem usually occurs when you try to access a project name/path,etc, when it is not avialable or you might have forget to instantiate the IProject object or try to instantiate the IProject with different name.
Solution: Have a look at your code where you are calling
getProject.
Check names, paths are called correctly.
public IProject getProject(String JavaDoc name) { //first check our project cache Project result = (Project) projectTable.get(name); if (result == null) { IPath projectPath = new Path(null, name).makeAbsolute(); String JavaDoc message = "Path for project must have only one segment."; //$NON-NLS-1$ Assert.isLegal(projectPath.segmentCount() == ICoreConstants.PROJECT_SEGMENT_LENGTH, message); //try to get the project using a canonical name String JavaDoc canonicalName = projectPath.lastSegment(); result = (Project) projectTable.get(canonicalName); if (result != null) return result; result = new Project(projectPath, workspace); projectTable.put(canonicalName, result); } return result; }
Read more: “Java > Open Source Codes > org > eclipse > core > internal > resources > WorkspaceRoot _ Java API By Example, From Geeks To Geeks.” – http://kickjava.com/src/org/eclipse/core/internal/resources/WorkspaceRoot.java.htm#ixzz0H1TWbu8u&A

