【问题标题】:how to remove custom eclipse project and all its references externally如何从外部删除自定义 Eclipse 项目及其所有引用
【发布时间】:2014-05-18 07:08:11
【问题描述】:

我在 Ubuntu 14.04 上使用 Eclipse Kepler。

我试图导入以下 Openjdk8 项目 https://java.net/projects/adoptopenjdk/pages/EclipseProjectsForOpenJDK

并在此过程中试图创建 swing 项目。但是开普勒在从现有的 ant 构建文件创建一个新的 java 项目时意外停止。

当我重新启动 Kepler 时,它拒绝启动。我在 .log 文件中检查了一些错误并发现

!ENTRY org.eclipse.osgi 4 0 2014-05-18 11:27:24.097
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTError: Not implemented [multiple displays]
at org.eclipse.swt.SWT.error(SWT.java:4423)
at org.eclipse.swt.widgets.Display.checkDisplay(Display.java:767)
at org.eclipse.swt.widgets.Display.create(Display.java:908)...

由于创建 swing 项目时出错,我决定手动将其重命名为 at。

  • 当前工作区。
  • .metadata/org.eclipse.core.resources/.projects

当我重新启动开普勒时。我遇到了与项目 swing 相关的错误。

!SUBENTRY 1 org.eclipse.core.resources 4 567 2014-05-18 11:27:23.553
!MESSAGE Could not read metadata for 'swing'.
!STACK 1
 org.eclipse.core.internal.resources.ResourceException(~/.../.metadata/.plugins/org.eclipse.core.resources/.projects/swing/1.tree)[568]: java.io.FileNotFoundException: ~/.../.metadata/.plugins/org.eclipse.core.resources/.projects/swing/1.tree (No such file or directory)
at java.io.FileOutputStream.open(Native Method)


!MESSAGE Could not write metadata for '/swing'.
!STACK 0
java.io.FileNotFoundException:     
~/.../.metadata/.plugins/org.eclipse.core.resources/.projects/swing/1.tree (No such file or directory)
...

Contains: The project description file (.project) for 'swing' is missing.  This file   contains important information about the project.  The project will not function properly   until this file is restored.
!SUBENTRY 2 org.eclipse.core.resources 4 271 2014-05-18 11:27:24.608
!MESSAGE Errors occurred while refreshing resources with the local file system.

我已经按照其他帖子中的建议创建了一个新的工作区,并且工作正常。

但我很想知道我的项目引用还存储在哪里以及如何手动删除它们以在现有工作区上工作。

【问题讨论】:

    标签: eclipse eclipse-kepler


    【解决方案1】:

    任何插件都可以将有关工作空间的数据保存在.metadata 目录中,因此实际上不可能有一个明确的引用存储位置列表。

    引用存储在.metadata/.plugins/org.eclipse.core.resources/.root 目录下的nnnn.tree 文件中。这是一个二进制文件,其中包含工作区中所有项目、文件夹和文件的列表。手动更改此文件实际上是不可能的。使用 -clean 选项重新启动 Eclipse 似乎会重建此文件。

    【讨论】:

    • 在花了几个小时敲打我的头并在 .metadata 下改组文件之后,我终于找到了适合我的解决方案。 1. 停止 Eclipse。 2. 在您的工作区中重命名 project_name。 3. 重命名 {$workspace}/.metadata/.plugins/org.eclipse.core.resources/.projects/ 中的 project_name 4. 重命名 {$workspace}/.metadata/.plugins/org.eclipse.core 中的文件 .snap .resources/ 5. 启动 Eclipse。在我的例子中,project_name 是 swing。如果可行,可以安全地删除重命名的文件夹。
    • 我确实在 nnn.tree(在我的例子中是 181.tree)中看到了我的其他项目,除了我试图找到的项目。
    猜你喜欢
    • 2014-04-20
    • 2020-11-10
    • 2021-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多