2011-12-10 143 views
17

我有一个项目,我试图添加到我的工作区。但是eclipse无法在我指向的目录中检测到新项目。Eclipse - 导入现有项目?

如何让eclipse知道特定的目录包含一个项目?

我的目录包含:

  • 资产
  • 资源
  • SRC
  • AndoridManijest.xml
  • proguard.cfg
  • project.properties

回答

13

你只需要做一个导入 - >现有项目到工作空间,然后浏览到的.classpath和.project文件存在项目的位置。

+0

没有.classPath或.project文件。我试图创建一个全新的项目,但我仍然没有得到这些文件 – aryaxt

+1

纠正我,如果我错了,你试图导入一个项目,其他人从他的eclipse工作区导出。如果是,他们应该在顶层目录,如果不是,1)它不是一个eclipse项目?那么你如何期待日食知道有一个它可以识别的项目。 2)如果它应该是一个eclipse项目,那么导出的人一定会搞砸了。 – FUD

+0

谢谢,我解决了它。我将我的项目内容从1个目录复制到另一个目录,但它没有复制.classpath和.project文件。这两个文件是隐藏的,这就是为什么我认为它们不存在。我将它们复制到新目录中,并修复了问题 – aryaxt

8

对于Eclipse的新版本,它是File > Import > General > Existing projects into workspace

+1

这是我需要的信息。谢谢。 –

+0

最受欢迎:)你可能想试试Netbeans。我发现它比Eclipse更容易使用。只是在Eclipse-Netbeans火焰战争中的另一个声音:) – Nav

+0

嗯。 。 。实际上,在我使用PHP之前,我使用过netbeans。我不记得很多的经验。 –

1

喜欢这个

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. 
0

该解决方案是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 
0

,如果你不能导入项目像一些上述方案,您应该创建新的项目有名称procject喜欢这procject要导入。请记住将您的导入项目放入工作站。