Computing Magazine

How To Import Git Project as Java Project in Eclipse

Posted on the 21 February 2013 by Abhishek Somani @somaniabhi
Follow  simple steps to create a java project from git repository in eclipse :
  1. Create a git repository 
  2. Now in eclipse , use import wizard , select "Existing Projects in to workspace" and give path to your local git repository where the project files are located
  3. It will create the project , but it will be a simple project
  4. Now go to git repository location , there should be .project file which is created by eclipse 
  5. in .project file replace this code 

  6. <buildSpec></buildSpec>
    <natures></natures>
    
    
    to this code :
    <buildSpec>
      <buildCommand>
     <name>org.eclipse.jdt.core.javabuilder</name>
     <arguments>
     </arguments>
      </buildCommand>
    </buildSpec>
    <natures>
       <nature>org.eclipse.jdt.core.javanature</nature>
    </natures>
    
    
Now it will be converted to java project. Configure the build path accordingly . If there is pom.xml then you can convert it to maven project by right click the project and select convert to option then select maven project .


Back to Featured Articles on Logo Paperblog