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
If you don't have I just have .project
and .classpath
files in the directory, the only way that works (for me at least) with the latest version of Eclipse is:
File
-> New
-> Project...
-> Android
-> Android Application Project
-> Next >
src
file in the Package ExplorerGeneral
-> File System
-> Next >
Browse
to your project, select the necessary files, hit Finish
After this, you should have a project with all your existing code as well as new .project
and .classpath
files.
After a long time finally i found that! Here my Way: File -> New Project -> Android Project From Existing Code -> Browse to your project root directory finish!
In order to resolve this problem for android projects. follow the below mentioned steps new->android project->create project from existing source and in this you can give your code location. Now, it will import all the specified project code and will work fine
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.
if you are building a maven project through a command console, make sure the following is at the end of the command:
eclipse:eclipse -Dwtpversion=2.0
I had the same issue when I've modified .project xml-file. When I reverted files to original version the project was created, then I was able to import project. Maybe it helps someone who has the same kind of problem ;)