Skip to content

How to Configure Gradle on Eclipse

Corrina Del Greco edited this page Oct 22, 2020 · 3 revisions

Gradle

Gradle is a build system designed to work with Java.

Useful Gradle commands

  • clean - deletes the build directory
  • build - assembles and tests this project
  • run - runs this project as a JVM application Example: gradle clean build run to do everything in one command

How to Configure Gradle on Eclipse

Gradle Installation

  • Download the Gradle binary here
  • Follow the instructions for installing Gradle here

Gradle Eclipse Pug-In

  • Install the Gradle plug-in from the Eclipse Marketplace (if it isn't already installed)
    • In Eclipse, go to Help > Eclipse Marketplace, and search for "Buildship Gradle Integration"

How to Use Gradle in Eclipse

  • In Eclipse you may have to right-click the project and click Configure > Add Gradle Nature
  • Now, go to Window > Show View > Other..., and search for "Gradle Tasks"
  • There will be a window at the bottom of your screen open called "Gradle Tasks" where you can choose which Gradle tasks to run
    • You can expand the project folder to see the Gradle task categories
    • Running the build > build task will compile the project
    • Running the application > run task will run the project and its tests

Clone this wiki locally