Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse not recognizing project as Gradle Project

Tags:

eclipse

gradle

I want to build a project with gradle. I have included build.gradle in my project. But eclipse is not recognizing it as gradle project and I can't build it. Can anybody give a solution for this.

like image 764
Midhun M R Avatar asked Feb 07 '13 12:02

Midhun M R


People also ask

Does Eclipse work with Gradle?

Buildship is an Eclipse plugin that allows you to build applications and libraries using Gradle through your IDE.

How do I know if Gradle is installed in Eclipse?

1 Answer. Show activity on this post. Select 'Help > About Eclipse' (on Macs this is 'Eclipse > About Eclipse'). Click the 'Installation Details' button to display the installation details dialog.


3 Answers

I just had this problem in Spring Tool Suite.

Here's what I did.

  1. Right-click on project for context menu.
  2. Go to "Configure" near the bottom of menu (for me)
  3. Select sub-menu option of "Convert to Gradle project".
  4. Refresh project.

The imported project's build.gradle then appeared in the drop-down options of the Gradle view.

like image 132
Pytry Avatar answered Sep 18 '22 22:09

Pytry


If you are using the Buildship Eclipse plugin for Gradle integration, you can try to add the following snippet into your build.gradle file:

eclipse {
    project.natures 'org.eclipse.buildship.core.gradleprojectnature'
    .....
}

Then run "gradle eclipse" to re-generate Eclipse project files and refresh your project in Eclipse.

like image 20
nybon Avatar answered Sep 18 '22 22:09

nybon


In Eclipse Neon you:

Right-click on your project --> Configure --> Add Gradle Nature.

Your project will automatically refresh and you will see all the dependencies being downloaded by Gradle.

like image 39
specialk1st Avatar answered Sep 22 '22 22:09

specialk1st