gpt4 book ai didi

exception - 如何解决 org.eclipse.core.internal.resources.ResourceException

转载 作者:行者123 更新时间:2023-12-04 14:41:21 37 4
gpt4 key购买 nike

我以前从未遇到过这种异常

org.eclipse.core.internal.resources.ResourceException: Resource '/External Plug-in Libraries' is not open.
at org.eclipse.core.internal.resources.Project.checkAccessible(Project.java:137)
at org.eclipse.core.internal.resources.Project.isNatureEnabled(Project.java:817)
at newmodulewizrd.ui.Integrate.printProjectInfo(Integrate.java:130)
at newmodulewizrd.ui.Integrate.getWorkSpace(Integrate.java:123)
at newmodulewizrd.ui.Integrate.presentOptionsAndAddToMain(Integrate.java:117)
at newmodulewizrd.ui.Integrate$2.actionPerformed(Integrate.java:84)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)

这是我的代码

try {
if (project.isNatureEnabled("org.eclipse.jdt.core.javanature")) {
IJavaProject javaProject = JavaCore.create(project);
if(flag2==0) {
printPackageInfos(javaProject);
flag2=1;
} else {
IPackageFragmentRoot srcFolder = cm.createNewSourceFolder(project);
newModule = srcFolder.createPackageFragment(textfield.getText(), true,null);
printPackageInfos(javaProject);
try {
cm.refreshWorkspace();
} catch (CoreException e) {
e.printStackTrace();
}
}
} else {
System.out.println("something went wrong here");
}
} catch (CoreException e) {
e.printStackTrace();
}

我怀疑它正在尝试访问我的 java 项目中的“jre 系统库 [jre6] 文件夹 {below my src folder}”

关于如何解决它有任何想法吗?

最佳答案

我找到了问题的解决方案,所以我把它贴在这里,这样任何有同样问题的人都可以受益

显然这里有一个指向“幻影项目”的链接

Phantom project in an Eclipse plugin

所以我按照步骤操作

1. Activate the 'Plug-ins' view by going to Window > Show View > Other > PDE > Plug-ins.

2. Select all plug-ins in the view.

然后重新启动我的 IDE。我的“外部插件库 Java 项目”现在可见。我删除了这个项目,现在一切都很好。

关于exception - 如何解决 org.eclipse.core.internal.resources.ResourceException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8390021/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com