Thursday 3 April 2014

Import a Java project into Eclipse from git

Problem: You try to import a Java project from Github into Eclipse where the original project was not created in Eclipse. You have the choice to import as a standard project and it is not quite so obvious how you convert that project into a Eclipse Java project.

Solution: For this example I will use https://github.com/haydenmuhl/nes it is a NES emulator written in Java that does not include the Eclipse project configuration.

Step 1: Go to https://github.com/haydenmuhl/nes and get the git URL.

Step 2: Right click on the project explorer in Eclipse and choose import > GIT > Project from GIT.


Step 3: Choose Clone URI.

Step 4: Enter the URL from github (https://github.com/haydenmuhl/nes.git).

Step 5: Choose the master branch and press next and choose import as general project.


Step 6: Click next and finish, you will notice you have a new project in your workspace.

Step 7: Right click the nes project and choose properties, search for the string "facets" and choose Project Facets.

Step 8: Convert to Faceted Form, check Java and press OK.


Step 9: Configure your build path if there are any errors.

You can now Right click, run as java application along with all of the other great features that come with having a Java project in Eclipse.


No comments:

Post a Comment