eclipse - 恢复丢失的项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5019929/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 19:57:02  来源:igfitidea点击:

eclipse -restore missing projects

eclipse

提问by trs

For some unknown reason the projects that I created in a workspace are no longer listed in the package explorer tab. The actual files of the programs still exist on the flash drive which was the designated workspace. How do I correct this problem so that I can access the projects in this workspace?

由于某种未知原因,我在工作区中创建的项目不再列在包资源管理器选项卡中。程序的实际文件仍然存在于指定工作区的闪存驱动器上。如何更正此问题以便我可以访问此工作区中的项目?

采纳答案by orbfish

Create new project on the menu, then select the button "Create project from existing source" and select your project directory on disk.

在菜单上创建新项目,然后选择按钮“从现有源创建项目”并选择磁盘上的项目目录。

回答by Isaac Truett

Are you in a different workspace? Try File > Switch Workspaceor if you are in the right workspace already, you could try File > Import > General > Existing Projects into Workspaceand re-import the projects.

你在不同的工作区吗?尝试File > Switch Workspace或者如果您已经在正确的工作区中,您可以尝试File > Import > General > Existing Projects into Workspace重新导入项目。

回答by Steve Westbrook

If you are working with Android projects, the straight import does not work. The fastest way I've found to deal with this issue is to move (not copy) the projects to a different location, then import them back into the workspace, making sure copying the files into the original workspace.

如果您正在处理 Android 项目,则直接导入不起作用。我发现处理这个问题的最快方法是将项目移动(而不是复制)到不同的位置,然后将它们导入回工作区,确保将文件复制到原始工作区。

At this time, the Android eclipse plugin has a bug in it which will rename your projects to the package names, rather than using the "friendly" names you intended for the projects. Since eclipse quite often seems to drop projects in this way, this can lead to a great deal of frustration. If this bug is fixed, or you know of a workaround, I would appreciate hearing about it.

目前,Android eclipse 插件有一个错误,它会将您的项目重命名为包名称,而不是使用您打算用于项目的“友好”名称。由于 eclipse 似乎经常以这种方式放弃项目,这可能会导致很大的挫败感。如果此错误已修复,或者您知道解决方法,我将不胜感激。

回答by user3831252

I had a case where my project disappeared from the workspace and when I tried to import the existing project into workspace, Eclipse reported the project was already in the workspace! So I simply created a new project with the same name/location as the folder in which the project was located. This brought the project back to life in my worskpace. This worked in Kepler version of Eclipse.

我有一个案例,我的项目从工作区中消失了,当我尝试将现有项目导入工作区时,Eclipse 报告该项目已经在工作区中!所以我只是创建了一个与项目所在文件夹具有相同名称/位置的新项目。这使该项目在我的工作空间中恢复生机。这在 Eclipse 的开普勒版本中有效。

回答by SunilJ

I found a way to resolve this issue without creating a new project.

我找到了一种无需创建新项目即可解决此问题的方法。

My projects disappeared from the Package Explorer view when I was in the Java EE perspective. When I switched to the Java perspective, they reappeared in Package Explorer.

当我在 Java EE 透视图中时,我的项目从 Package Explorer 视图中消失了。当我切换到 Java 透视图时,它们重新出现在包资源管理器中。

Version: Mars.2 Release (4.5.2) Build id: 20160218-0600

版本:Mars.2 Release (4.5.2) 版本号:20160218-0600

Not sure what caused this issue out of the blue and how long this solution will hold.

不确定是什么原因导致了这个问题,以及这个解决方案会持续多久。

回答by QuantumQuan

A simple solution that requires deleting the affected projects from your workspace, then importing them again:

一个简单的解决方案,需要从您的工作区中删除受影响的项目,然后再次导入它们:

  1. Delete the affected projects from your workspace (do not delete from disk)
  2. Open the files. File >> Open Project from File System >> Select location of files >> Select projects to open.
  3. After you import them, it should work.
  1. 从您的工作区中删除受影响的项目(不要从磁盘中删除)
  2. 打开文件。文件>>从文件系统打开项目>>选择文件位置>>选择要打开的项目。
  3. 导入它们后,它应该可以工作。

回答by Gilbert Le Blanc

Try a refresh (F5) of the workspace.

尝试刷新 (F5) 工作区。