Supported JDK Versions
Android Code Studio includes support for:- JDK 11 - For projects using Android Gradle Plugin 7.x
- JDK 17 (Recommended) - For projects using Android Gradle Plugin 8.x and newer
- JDK 21 - For cutting-edge development
JDK 17 is the default and recommended version for most Android development.
JDK Installation Location
JDK installations are located in:/data/data/com.tom.rv2ide/files/usr/lib/jvm/java-17-openjdk/data/data/com.tom.rv2ide/files/usr/lib/jvm/java-21-openjdk
Configuring JDK Version
Via Preferences UI
Select JDK Version
Tap on JDK Version preferenceYou’ll see a list of installed JDK distributions with their version numbers.
Via Configuration File
The JDK preference is stored as:Java Home Path - Full path to the selected JDK installationExample value:
/data/data/com.tom.rv2ide/files/usr/lib/jvm/java-17-openjdkJDK Detection
The IDE automatically detects installed JDK distributions using the following process:Validate Installation
Checks for valid
bin/java executable:- File exists
- Is a regular file (not a symlink)
- Has executable permissions
Extract Version Information
Executes the Java binary to get version details:Extracts:
java.version- Version string (e.g., “17.0.7”)java.home- Actual installation path
Default JDK Selection
On first launch, the IDE automatically selects a default JDK:- Prefers JDK 17 if available (recommended for Android development)
- Falls back to first available JDK if JDK 17 is not installed
- Validates selection to ensure the installation is functional
Environment Variables
The selected JDK sets the following environment variables:Installing Additional JDK Versions
Android Code Studio uses Termux packages for JDK installations.Install via pkg
Use the
pkg command to install JDK packages:Installation requires an internet connection and may take several minutes.
Switching JDK Versions
When to Switch
Switch JDK versions based on your project requirements:| Android Gradle Plugin | Minimum JDK | Recommended JDK |
|---|---|---|
| AGP 7.0 - 7.4 | JDK 11 | JDK 11 |
| AGP 8.0+ | JDK 17 | JDK 17 |
| AGP 8.4+ | JDK 17 | JDK 21 |
Switching Process
Change in Preferences
Go to Settings > Build & Run > JDK VersionSelect the desired version from the list
Troubleshooting
JDK Not Detected
If a JDK installation is not detected:Build Fails with JDK Error
If builds fail with JDK-related errors:-
Check AGP Compatibility
-
Verify JAVA_HOME
-
Clear Gradle Cache
Multiple JDK Versions Not Showing
If only one JDK appears despite multiple installations:Symbolic links are intentionally ignored during JDK detection to avoid duplicate entries.
JDK Configuration Best Practices
Advanced Configuration
Custom JDK Installation
To use a custom JDK installation:- Install JDK to
$PREFIX/lib/jvm/custom-jdk/ - Ensure Structure:
- Set Permissions:
- Restart IDE to detect the new installation