Why “no projects found to import”?

后端 未结 11 1669
臣服心动
臣服心动 2020-12-02 04:39

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

相关标签:
11条回答
  • 2020-12-02 05:26

    This answer is same as Laura's answer , however, in new eclipse versions you will not be able to see a "create project from existing source" option.

    Hence you can do this instead:

    • Goto File > New > Project

    • Select the type of project, click Next

    • Uncheck Use default location

    • Click on Browse to navigate to your source folder, or type in the path to your source

    • Click Finish

    Taken from this discussion forum in eclipse.org

    0 讨论(0)
  • 2020-12-02 05:26

    In new updated eclipse the option "create project from existing source" is found here, File>New>Project>Android>Android Project from Existing Code. Then browse to root directory.

    enter image description here

    0 讨论(0)
  • 2020-12-02 05:27

    One solution to this is to use Maven. From the project root folder do mvn eclipse:clean followed by mvn eclipse:eclipse. This will generate the .project and .classpath files required by eclipse.

    0 讨论(0)
  • 2020-12-02 05:27

    I have a perfect solution for this problem. After doing following simple steps you will be able to Import your source codes in Eclipse!


    First of all, the reason why you can not Import your project into Eclipse workstation is that you do not have .project and .classpath file.

    Now we know why this happens, so all we need to do is to create .project and .classpath file inside the project file. Here is how you do it:


    First create .classpath file:

    1. create a new txt file and name it as .classpath
    2. copy paste following codes and save it:

      <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="output" path="bin"/> </classpath>



    Then create .project file:

    1. create a new txt file and name it as .project
    2. copy paste following codes:

      <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>HereIsTheProjectName</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription>

    3. you have to change the name field to your project name. you can do this in line 3 by changing HereIsTheProjectName to your own project name. then save it.


    That is all, Enjoy!!

    0 讨论(0)
  • 2020-12-02 05:27

    Reason : your ID is not able to find the .project file. This happens in git commit where many time people don't push .project file

    Solution : If you have maven install then use following stapes

    1. mvn eclipse:clean
    2. mvn eclipse:eclipse

    Enjoy!

    0 讨论(0)
提交回复
热议问题