views:

566

answers:

1

I am trying to "import existing project into workspace". As the "root directory" I select the directory where all my .java (and .class) files are located. Eclipse writes me that "no projects are found to import". Why?

+2  A: 

Eclipse is looking for eclipse projects, meaning its is searching for eclipse-specific files in the root directory, namely .project and .classpath. You either gave Eclipse the wrong directory (if you are importing a eclipse project) or you actually want to create a new project from existing source(new->java project->create project from existing source).

I think you probably want the second one, because Eclipse projects usually have separate source & build directories. If your sources and .class files are in the same directory, you probably didn't have a eclipse project.

laura
I think you are right. I have removed ".project" and ".classpath" files from the directory and then I got the described problem. But I just tried to "create project from existing source". It seems to work. But I still do not have the ".project" and ".classpath" files into the directory. So, eclipse created a project but it did not create files associated with the project. Do you know why?
Roman
Check your workspace folder. I believe there should be a folder with the name of your project and the two files in it. One of them probably has the path to where your real classes are.
laura