---
description: Override the Java version used for Android builds in Capawesome Cloud. Configure JDK 17, JDK 21, or another version for your Capacitor project.
title: Override Java Version on Android Builds - Capawesome
image: https://capawesome.io/docs/assets/images/social/cloud/native-builds/guides/override-java-version.png
---

[ Skip to content](#override-java-version-on-android-builds) 

[ 🎉 Introducing **Capawesome Platform** — one platform for Live Updates, Native Builds, App Store Publishing, and Insider SDKs.](https://capawesome.io) 

* [  Formbricks ](/docs/plugins/formbricks/)
* [  Geocoder ](/docs/plugins/geocoder/)
* [  Google Sign-In ](/docs/plugins/google-sign-in/)
* [  libSQL ](/docs/plugins/libsql/)
* [  Live Update ](/docs/plugins/live-update/)
* [  Managed Configurations ](/docs/plugins/managed-configurations/)
* [  Media Session ](/docs/plugins/media-session/)
* [  ML Kit ](/docs/plugins/mlkit/)
* [  NFC ](/docs/plugins/nfc/)
* [  OAuth ](/docs/plugins/oauth/)
* [  Pedometer ](/docs/plugins/pedometer/)
* [  Photo Editor ](/docs/plugins/photo-editor/)
* [  PostHog ](/docs/plugins/posthog/)
* [  Printer ](/docs/plugins/printer/)
* [  Purchases ](/docs/plugins/purchases/)
* [  RealtimeKit ](/docs/plugins/realtimekit/)
* [  Screen Orientation ](/docs/plugins/screen-orientation/)
* [  Screenshot ](/docs/plugins/screenshot/)
* [  Secure Preferences ](/docs/plugins/secure-preferences/)
* [  Speech Recognition ](/docs/plugins/speech-recognition/)
* [  Speech Synthesis ](/docs/plugins/speech-synthesis/)
* [  Share Target ](/docs/plugins/share-target/)
* [  Square Mobile Payments ](/docs/plugins/square-mobile-payments/)
* [  SQLite ](/docs/plugins/sqlite/)
* [  Superwall ](/docs/plugins/superwall/)
* [  Torch ](/docs/plugins/torch/)
* [  Wifi ](/docs/plugins/wifi/)
* [  Zip ](/docs/plugins/zip/)
* [  Cloud ](/docs/cloud/)
* [  Live Updates ](/docs/cloud/live-updates/)
* Advanced
* Integrations
* [  Native Builds ](/docs/cloud/native-builds/)
* [  Configuration ](/docs/cloud/native-builds/configuration/)
* [  Environments ](/docs/cloud/native-builds/environments/)
* Guides
* [  Custom iOS Provisioning Profiles ](/docs/cloud/native-builds/guides/custom-ios-provisioning-profiles/)
* [  Install APK on Android Device ](/docs/cloud/native-builds/guides/install-apk-on-android-device/)
* [  Install IPA on iOS Device ](/docs/cloud/native-builds/guides/install-ipa-on-ios-device/)
* [  Sample Projects ](/docs/cloud/native-builds/sample-projects/)
* [  Troubleshooting ](/docs/cloud/native-builds/troubleshooting/)
* [  Automations ](/docs/cloud/automations/)
* [  Assist ](/docs/cloud/assist/)
* Account
* Organizations
* [  Organization and User Management ](/docs/cloud/organizations/memberships/)
* [  Single Sign-On (SSO) ](/docs/cloud/organizations/sso/)
* [  Teams ](/docs/cloud/organizations/teams/)
* [  Two-Factor Authentication ](/docs/cloud/organizations/two-factor-authentication/)
* [  Integrations ](/docs/cloud/integrations/)
* [  License Keys ](/docs/cloud/license-keys/)
* [  Webhooks ](/docs/cloud/webhooks/)
* [  Pricing ](https://capawesome.io/pricing/)
* [  FAQ ](/docs/cloud/faq/)
* [  Support ](/docs/cloud/support/)
* [  Contributing ](/docs/contributing/)
* [  LLMs ](/docs/llms/)
* [  Insiders ](/docs/insiders/)
* [  License ](https://capawesome.io/legal/eula/)
* [  Support ](/docs/insiders/support/)
* [  FAQ ](/docs/insiders/faq/)
* [  Blog ](/blog/)
* Categories

# Override Java Version on Android Builds[¶](#override-java-version-on-android-builds "Permanent link")

Capawesome Cloud automatically detects the Android Gradle Plugin version used in your project and applies the corresponding Java version. However, you can manually override the Java version if needed.

## Automatic Java Version Detection[¶](#automatic-java-version-detection "Permanent link")

Capawesome Cloud supports Gradle Plugin Version 8.0.0 and higher. The Java version is automatically selected based on your Android Gradle Plugin version:

| Android Gradle Plugin | Java Version |
| --------------------- | ------------ |
| 8.0.0 - 8.7.1         | 17           |
| \>= 8.7.2             | 21           |

This automatic detection ensures your builds use the appropriate Java version without additional configuration.

## Override Java Version[¶](#override-java-version "Permanent link")

To override the automatic Java version selection, set the `JAVA_VERSION` environment variable:

1. Navigate to the [Environments](https://console.cloud.capawesome.io/apps/%5F/environments) page
2. Select your environment or create a new one
3. Add a variable named `JAVA_VERSION`
4. Set its value to the major version number (e.g., `17` or `21`)
Version constraints 

The `JAVA_VERSION` environment variable must be set to an integer representing the major version, such as `17` or `21`. For available Java versions, refer to the [Build Stacks](/docs/cloud/native-builds/build-stacks/) documentation.

## Example[¶](#example "Permanent link")

To use Java 17 for your Android builds regardless of your Gradle Plugin version:

1. Add an environment variable named `JAVA_VERSION` with the value `17`
2. Select this environment when triggering your build

The specified Java version will be used instead of the automatically detected version.

May 7, 2026 

 Back to top 