今天在开发eclipse创建一个插件,通过测试环境结果报如下错误
org.eclipse.core.internal.resources.ResourceException: Invalid project description.
at org.eclipse.core.internal.resources.Project.checkDescription(Project.java:124)
at org.eclipse.core.internal.resources.Project.create(Project.java:227)
at org.netliving.studio.project.wizards.StudioProjectWizard.createProject(StudioProjectWizard.java:186)
at org.netliving.studio.project.wizards.StudioProjectWizard.createNewProject(StudioProjectWizard.java:150)
at org.netliving.studio.project.wizards.StudioProjectWizard.createStudioProject(StudioProjectWizard.java:106)
at org.netliving.studio.project.wizards.StudioProjectWizard$1.run(StudioProjectWizard.java:74)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
--------------------------------------------------------------------------------------------------------------------------
有如下方式原因造成
1) In the "default" location. This means that the project directory is a direct child directory of the workspace directory (aka the platform instance location), and the project directory name matches the project name.
2) Outside the default location, in a directory that is neither a parent or child of the platform instance location. In this case the directory name does not need to match the project name.
后来在创建工程的时候又出现如此错误
org.eclipse.core.internal.resources.ResourceException: Resource '/y' does not exist.
at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:310)
at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:193)
at org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:94)
at org.eclipse.core.internal.resources.Folder.assertCreateRequirements(Folder.java:32)
at org.eclipse.core.internal.resources.Folder.create(Folder.java:88)
at org.eclipse.core.internal.resources.Folder.create(Folder.java:118)
at org.netliving.studio.project.wizards.StudioProjectWizard.createFolder(StudioProjectWizard.java:491)
at org.netliving.studio.project.wizards.StudioProjectWizard.createFolder(StudioProjectWizard.java:490)
at org.netliving.studio.project.wizards.StudioProjectWizard.createFolder(StudioProjectWizard.java:490)
at org.netliving.studio.project.wizards.StudioProjectWizard.createOutputLocation(StudioProjectWizard.java:232)
at org.netliving.studio.project.wizards.StudioProjectWizard.createStudioProject(StudioProjectWizard.java:121)
at org.netliving.studio.project.wizards.StudioProjectWizard$1.run(StudioProjectWizard.java:85)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
!SUBENTRY 1 org.eclipse.core.resources 4 368 2008-07-19 00:14:41.875
!MESSAGE Resource '/y' does not exist.
!ENTRY org.netliving.studio.project 4 4 2008-07-19 00:19:23.015
!MESSAGE create project
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Invalid project description.
at org.eclipse.core.internal.resources.Project.checkDescription(Project.java:124)
at org.eclipse.core.internal.resources.Project.create(Project.java:227)
at org.netliving.studio.project.wizards.StudioProjectWizard.createProject(StudioProjectWizard.java:207)
at org.netliving.studio.project.wizards.StudioProjectWizard.createNewProject(StudioProjectWizard.java:171)
at org.netliving.studio.project.wizards.StudioProjectWizard.createStudioProject(StudioProjectWizard.java:117)
at org.netliving.studio.project.wizards.StudioProjectWizard$1.run(StudioProjectWizard.java:85)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
!SUBENTRY 1 org.eclipse.core.resources 4 77 2008-07-19 00:19:23.015
!MESSAGE Invalid project description.
!SUBENTRY 2 org.eclipse.core.runtime 2008-07-19 00:19:23.015
!MESSAGE OK
!SUBENTRY 2 org.eclipse.core.resources 4 77 2008-07-19 00:19:23.015
!MESSAGE E:\runtime-EclipseApplication\p overlaps the location of another project: 'p'
然后google终于查询处了结果,并解决掉了
The resource APIs are a bit tricky here. When you create a new project,
you should specify the project location as null if you want it to go in
the default location -- i.e., <workspace root> / <project name>.
Only use IProjectDescription#setLocation[URI]() to set a non-null
location if it *won't* live in that default location, otherwise you'll
get the "overlapping location" error.
规则阿。。。。