如何从 Eclipse 中的工作区打开项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8629333/
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
How to open project from workspace in Eclipse?
提问by koleS
I imported an Eclipse project into workspace and after some time I deleted it in Eclipse (from project explorer but not from workspace). Now, I want to reopen it, or import it again, but I cannot import it because such a project already exists in the workspace and when I try to open it, in tab Project -> Open Project
, it is disabled. Of course, I can delete the project from workspace and import it again, but this is not what I want. So the question is: how can I open the project, which is in Eclipse's workspace, but has been deleted from the Eclipse's project explorer?
我将一个 Eclipse 项目导入到工作区中,一段时间后我在 Eclipse 中删除了它(从项目资源管理器中而不是从工作区中)。现在,我想重新打开它,或再次导入它,但我无法导入它,因为工作区中已经存在这样的项目,当我尝试打开它时,在 tab 中Project -> Open Project
,它被禁用。当然,我可以从工作区中删除项目并重新导入,但这不是我想要的。所以问题是:如何打开位于 Eclipse 工作区中但已从 Eclipse 的项目资源管理器中删除的项目?
回答by user1010160
This is exactly what I just ran into. The 'Finish' button is greyed out, as is the check box and project name in the project window. If you try to check that check box the project will not be greyed now, but it won't check. Refresh does nothing.
这正是我刚刚遇到的。“完成”按钮变灰,项目窗口中的复选框和项目名称也是如此。如果您尝试选中该复选框,则项目现在不会变灰,但不会选中。刷新没有任何作用。
The trick (or is it a bug) is to uncheck 'copy projects into workspace' hit the refresh button and it will now be checked and you can hit the finish button. Project will now once again be available in the Package Explorer. (I'm using Eclipse 3.8 and ADT 21.0.1)
技巧(或者它是一个错误)是取消选中“将项目复制到工作区”点击刷新按钮,现在将被选中,您可以点击完成按钮。Project 现在将再次在 Package Explorer 中可用。(我使用的是 Eclipse 3.8 和 ADT 21.0.1)
回答by Singhak
These Steps You Have to Follow
您必须遵循的这些步骤
- Click File menu
- In file menu click Import
- A window is open Now click General Folder
- Now click Existing project into workspace
- Then click the select from root directory
- Now import project which you want......
- 单击文件菜单
- 在文件菜单中单击导入
- 一个窗口打开 现在点击 General Folder
- 现在单击现有项目进入工作区
- 然后点击从根目录中选择
- 现在导入你想要的项目......
回答by dunni
You have to choose the project in the workspace, not the zip file with your project. Your project is still in your workspace, and because Eclipse wants to copy the project from the zip file you chose (look at the checked check box "Copy projects into workspace"), you get that warning.
您必须在工作区中选择项目,而不是项目的 zip 文件。您的项目仍在您的工作区中,并且因为 Eclipse 想要从您选择的 zip 文件中复制该项目(查看选中的复选框“将项目复制到工作区”),您会收到该警告。
Just select "Select root directory" and choose your workspace as your root directory and choose the project you want to reimport (and make sure, that the checkbox "Copy projects into workspace" is not checked).
只需选择“选择根目录”并选择您的工作区作为根目录,然后选择要重新导入的项目(并确保未选中“将项目复制到工作区”复选框)。
回答by BM2ilabs
- Go to “%ECLIPSE_HOME%\configuration.settings” and delete the workspace listed at the key RECENT_WORKSPACES
- Restart Eclipse, go to File>Switch Workspace>Other… and select your workspace dir again
- Now I could create new projects as always
- 转到“%ECLIPSE_HOME%\configuration.settings”并删除列在关键 RECENT_WORKSPACES 的工作区
- 重新启动 Eclipse,转到 File>Switch Workspace>Other... 并再次选择您的工作区目录
- 现在我可以像往常一样创建新项目
回答by YJS
One simple trick is to delete the project from your work-space directory manually and than try to import project again. That's it...
一个简单的技巧是手动从您的工作空间目录中删除项目,然后再次尝试导入项目。就是这样...
回答by Joolah
Importing existing projects You can use the Import Wizard to command link import an existing project into workspace.
导入现有项目 您可以使用导入向导命令链接将现有项目导入工作区。
From the main menu bar, select command link File > Import.... The Import wizard opens. Select General > Existing Project into Workspace and click Next. Choose either Select root directory or Select archive file and click the associated Browse to locate the directory or file containing the projects. Under Projects select the project or projects which you would like to import. Click Finish to start the import.
从主菜单栏中,选择命令链接文件 > 导入...。导入向导打开。选择 General > Existing Project into Workspace 并单击 Next。选择 Select root directory 或 Select archive file 并单击关联的 Browse 以找到包含项目的目录或文件。在项目下选择您要导入的一个或多个项目。单击完成开始导入。
回答by DevOpsMan
I've experienced this same problem. It was a deleted workspace which I re-imported. When I tried to work with junit tests in the directory, it said that parts of if were not in the "project" In order to fix this, I had to check the "SEARCH FOR NESTED PROJECTS" and that corrected the issue.
我也遇到过同样的问题。这是我重新导入的已删除工作区。当我尝试在目录中使用 junit 测试时,它说 if 的部分不在“项目”中为了解决这个问题,我不得不检查“搜索嵌套项目”并纠正了问题。
回答by Tylla
I know that this is a really old question, possibly the solution was not available back then, but on my system (Eclipse Photon 4.8.0) it works like this:
我知道这是一个非常古老的问题,当时可能没有解决方案,但在我的系统(Eclipse Photon 4.8.0)上,它的工作方式如下:
- File menu
- Open Projects from File System...
- 文件菜单
- 从文件系统打开项目...
Here you can give Eclipse a path to a directory (in this case your own, currently used workspace directory) where it will search for possible projects, list them and let you choose which one to import into the workspace. It will show already imported (aka. existing inside Eclipse) projects grayed out and unselectable, but has an option to hide these as well. After selecting the project you'd like to import just click the Finish button and voila.
在这里,您可以为 Eclipse 提供一个目录路径(在本例中是您自己的当前使用的工作区目录),它会在其中搜索可能的项目、列出它们并让您选择要将哪个项目导入到工作区中。它将显示已导入(也称为 Eclipse 中存在的)项目变灰且不可选择,但也可以选择隐藏这些项目。选择要导入的项目后,只需单击“完成”按钮即可。
回答by mohammadsdtmnd
Make sure that your project is included in current workspace, then you have to see the project under "Project Explorer".
确保您的项目包含在当前工作区中,然后您必须在“项目资源管理器”下看到该项目。
Note: you can view this from: Window->Show View->Project Explorer.
注意:您可以从以下位置查看:Window->Show View->Project Explorer。