How to configure a project imported from GIT to be a Java project in Eclipse?

I’ve imported a project from Git in Eclipse using this method:
File > Import > Git > Projects from Git > Next > Clone URL .

At this point I inserted the URI like this https://github.com/mygituser/My-Project .
Then my user and password, and the project was imported.

  • How do I add org.eclipse.core.resources.prefs to gitignore?
  • EGit: Pruning Remote Tracking Branches that have been Deleted on the Remote Repo
  • Building Eclipse IDE from scratch - how to specify the target OS?
  • How to automatically change Eclipse build path when I check out Git branches
  • How do I make a Scala project “Import from git”able in Eclipse?
  • Cannot commit to SVN
  • The problem is that Eclipse didn’t recognize it as a Java project, and I really don’t know why.

    As consequence, I can’t see errors or warnings on my project and neither use autocomplete, I’m getting this message “This compilation unit is not on the build path of a Java project”.

    Also, right click on My-Project > Build path shows the message “No actions avaliable”.

    If you need more information to help me, could you ask me on comments, please?
    I appreciate your attention!

  • How can I preserve line endings when I check out a single file to a different location with git?
  • Is there a way to git gc / prune on a remote Git repository hosted by TFS 2013?
  • difference from: git merge branch vs git merge branch master
  • Location of directory using git on ubuntu
  • How to run svn update in a loop to import commits to git?
  • Git clean not removing a file
  • 2 Solutions collect form web for “How to configure a project imported from GIT to be a Java project in Eclipse?”

    Most people don’t include build files in repositories, only source. What you need to do is create a new Eclipse project the create a Git repo on top of that:

    • Create a new Eclipse project, and go to it with your terminal.
    • git init to initialize a repo.
    • git remote add origin https://github.com/mygituser/My-Project to add the remote.
    • git pull -u origin master to pull the changes.

    Also, make sure that when you commit, you don’t add build files that the author kept out. You can do this via a .gitignore file. Simply take this file and add it to your project directory.

    This method applies to most Git repositories, as build and compiled files are usually left out.

    Note that this method requires that you install Git for command line (or Git Bash). You can get Git at their website.

    Since you already have the source code downloaded from the git repository, you should be able to create an Eclipse project from the existing source code.

    Git Baby is a git and github fan, let's start git clone.