Gradle is a build automation tool for Java, Kotlin, and Android projects, developed by Gradle Inc. It's tied for #18 among the most-used developer tools, reported in roughly 14.4% of developer surveys. It's a newer, more flexible alternative to Maven โ using a Groovy or Kotlin DSL script instead of XML โ and is the default build system built into Android Studio.
Modern Gradle projects typically use the Kotlin DSL in a build.gradle.kts file to declare plugins and dependencies.
// build.gradle.kts
plugins {
kotlin("jvm") version "1.9.22"
application
}
repositories {
mavenCentral()
}
dependencies {
implementation("com.squareup.okhttp3:okhttp:4.12.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.1")
}
application {
mainClass.set("com.example.MainKt")
}
Gradle projects ship with a wrapper script so nobody needs Gradle pre-installed โ running ./gradlew downloads the correct version automatically.
# run the project via the Gradle wrapper (no install needed)
./gradlew build
./gradlew run
# or install Gradle globally (macOS/Linux via SDKMAN)
sdk install gradle