18

I have a project that I am trying to add to my workspace. But eclipse cannot detect a new project in the directory I am pointing to.

How can I let eclipse know that a specific directory contains a project?

My directory contains:

  • assets
  • libs
  • res
  • src
  • bin
  • gen
  • AndoridManijest.xml
  • proguard.cfg
  • project.properties
aryaxt
  • 76,198
  • 92
  • 293
  • 442

5 Answers5

14

You just have to do a Import->Existing Project into Workspace, and then browse to the location where the .classpath and .project files exists for your project.

FUD
  • 5,114
  • 7
  • 39
  • 61
  • there are no .classPath or .project files. I tried creating a brand new project, and I still don't get these files – aryaxt Dec 10 '11 at 20:06
  • 1
    Correct me if i am wrong, you are trying to import a project which has been exported by someone else from his eclipse workspace. If yes they should be there at top directory, if No, 1) its not an eclipse project? then how can you expect eclipse to know there is a project which it can recognize. 2) If its supposed to be a eclipse project, then the person who exported must have messed up. – FUD Dec 10 '11 at 20:23
  • Thanks, I fixed it. I copied the content of my project from 1 directory to another, and it did not copy the .classpath and .project files. And these 2 files are hidden, that's why I thought they didn't exist. I copied them over to the new directory and it fixed the problem – aryaxt Dec 10 '11 at 20:47
11

For the new versions of Eclipse, it is File > Import > General > Existing projects into workspace

Nav
  • 19,885
  • 27
  • 92
  • 135
2

Like this

   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.
Thiago
  • 12,778
  • 14
  • 93
  • 110
0

This solution is for eclipse

I had a similar problem when I was cloning repositories from bit bucket from the command line, it would clones into the local repository. So the above solution did not work because it would say that the files were already in the local repository.

The solution:

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
Gioan Nguyen
  • 37
  • 10
0

if you cannot import project like some above solution, you should create new project has name procject like which procject you want to import. Remember to put your import project into workstation.

mr_sudo
  • 386
  • 2
  • 12