我有一个项目正在尝试添加到我的工作区。但是 Eclipse 无法在我指向的目录中检测到新项目。
如何让eclipse知道特定目录包含项目?
我的目录包含:
您只需执行“导入”->“现有项目到工作区”,然后浏览到项目的 .classpath 和 .project 文件所在的位置。
对于新版本的 Eclipse,是
File > Import > General > Existing projects into workspace
像这样
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.
此解决方案适用于 Eclipse
当我从命令行从位存储桶克隆存储库时,我遇到了类似的问题,它会克隆到本地存储库。所以上面的解决方案不起作用,因为它会说文件已经在本地存储库中。
解决方案:
1. Window > Show View > other > Git repositories
2. Right Click on the git repository tab > import projects
3. navigate to the repository you want to put into eclipse
4. select the third option 'import as general project', if selecting this does not work then view other options and select the option that applies to you
5. finish
如果您无法像上面的解决方案一样导入项目,您应该创建新项目,其名称为 procject,就像您要导入的项目一样。记得将导入的项目放入工作站。