Search code examples
javagitimportlibgdxbitbucket

How do I import gradle projects with with EGit in Eclipse? (libGDX)


I am quiet new to git but for now I have set up a repository on Bitbucket. The repository contains my libGdx Project which is gradle project containing 3 sub-projects (Android, Desktop and Core).

So now it is my aim to clone this to eclipse using EGit. Everything works until i have to choose a wizard for the Import of the projects.

After i added the repo i use Import > git to Import a Project from the added repository After i added the repo i use Import > git to Import a Project from the added repository

Here i have to choose the wizard Here i have to choose the wizard

If i choose "Import existing Projects" the program tells me that no Projects are found.

After that i tried the "Use the New Project wizard" but it confuses me and actually i want to Import a gradle Project and not create a new one.

The last Option "Import as General Project" gives me just Folders and files, so eclipse doesn't notice the existing Projects. Like i said i'm quiet new to git so i appreciate every help ! :)

Thanks :)


Solution

  • the best way is "Import -> Gradle project" (you need to have gradle plugin installed in eclipse first)

    But is you don't want to use gradle plugin you need first to generate eclipse file. To do so, type "gradle eclipse" in your working directory (see https://docs.gradle.org/current/userguide/eclipse_plugin.html) and then import existing project into your eclipse workspace.

    Another thing, it seems that your workspace is in the same folder as sources (.metadata folder), you should create your eclipse workspace in another directory.