./scripts/provision.sh / playbooks/site.yml should install a full JDK 21 (with javac) and export JAVA_HOME so the self-hosted Gitea Act runner can compile Capacitor Android (AGP 8.7.2, JavaVersion.VERSION_21).
Today provision installs Node (roles/nodejs) but not Java. Android Gradle on the runner/control node fails because the OS Java is a JRE only.
Related: #9 (Android CI toolchain — JDK was listed as 17+; Capacitor 7 needs 21). This ticket is the provision-step slice: apt JDK + JAVA_HOME. SDK/keystore stay on #9.
Triggered by dta_webapp#65 store AAB work (ditch-the-agent/android).
Current state (ai-server-4080 / runner host)
What
Status
Apt packages
openjdk-21-jre + openjdk-21-jre-headless only — no javac
JAVA_HOME
unset
which javac
missing from PATH
Unpackaged JDK
/home/westfarn/.local/jdk/jdk-21.0.12+8/bin/javac exists but is not what Act/Gradle use
Android SDK
~/Android/Sdk has platform 35 (and 36.1); build-tools 34.0.0 + 36.0.0
Ansible
roles/common base packages have no JDK; site.yml has no jdk role
Capacitor writes sourceCompatibility JavaVersion.VERSION_21 in android/app/capacitor.build.gradle. JRE 21 is not enough; Gradle cannot compile.
Work
1. Ansible role (provision)
Add a small role modeled on roles/nodejs, applied from playbooks/site.yml (at least on ai-server-4080 / act_runner_enabled; installing on all webservers is fine and cheap).
./scripts/provision.sh ai-server-4080 installs openjdk-21-jdk (or documented equivalent) with javac on PATH
JAVA_HOME is /usr/lib/jvm/java-21-openjdk-amd64 (or the distro JDK path) for the Act runner user
javac -version reports 21 without using ~/.local/jdk/...
JRE-only packages are not the only Java install
Provision docs list JDK 21 beside Node
## Summary
`./scripts/provision.sh` / `playbooks/site.yml` should install a **full JDK 21** (with `javac`) and export `JAVA_HOME` so the self-hosted Gitea Act runner can compile Capacitor Android (AGP 8.7.2, `JavaVersion.VERSION_21`).
Today provision installs Node (`roles/nodejs`) but **not Java**. Android Gradle on the runner/control node fails because the OS Java is a **JRE only**.
Related: #9 (Android CI toolchain — JDK was listed as 17+; Capacitor 7 needs **21**). This ticket is the **provision-step** slice: apt JDK + `JAVA_HOME`. SDK/keystore stay on #9.
Triggered by [dta_webapp#65](https://git.aimloperations.com/Ditch_The_Agent/dta_webapp/pulls/65) store AAB work (`ditch-the-agent/android`).
---
## Current state (ai-server-4080 / runner host)
| What | Status |
|------|--------|
| Apt packages | `openjdk-21-jre` + `openjdk-21-jre-headless` only — **no `javac`** |
| `JAVA_HOME` | unset |
| `which javac` | missing from `PATH` |
| Unpackaged JDK | `/home/westfarn/.local/jdk/jdk-21.0.12+8/bin/javac` exists but is **not** what Act/Gradle use |
| Android SDK | `~/Android/Sdk` has platform **35** (and 36.1); build-tools 34.0.0 + 36.0.0 |
| Ansible | `roles/common` base packages have no JDK; `site.yml` has no jdk role |
Capacitor writes `sourceCompatibility JavaVersion.VERSION_21` in `android/app/capacitor.build.gradle`. JRE 21 is not enough; Gradle cannot compile.
---
## Work
### 1. Ansible role (provision)
Add a small role modeled on `roles/nodejs`, applied from `playbooks/site.yml` (at least on **ai-server-4080** / `act_runner_enabled`; installing on all `webservers` is fine and cheap).
Install **JDK**, not JRE:
```yaml
- name: Install OpenJDK 21 JDK
ansible.builtin.apt:
name: openjdk-21-jdk
state: present
update_cache: true
```
Do **not** treat `openjdk-21-jre` as sufficient.
Optional: `openjdk-21-jdk-headless` if you want no GUI bits; still must include `javac`.
### 2. JAVA_HOME for Act jobs
Point the runner user and non-interactive CI shells at the distro JDK, e.g.:
```text
JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64
PATH=$JAVA_HOME/bin:$PATH
```
Use `/etc/profile.d/java.sh` and/or `/etc/environment` so **Gitea Act** (non-login) sees it. Do not rely on `~/.local/jdk/jdk-21.0.12+8`.
### 3. Verify in the role
```bash
java -version # OpenJDK 21
javac -version # 21 (must exist)
echo "$JAVA_HOME"
```
### 4. Docs
- `scripts/provision.sh` usage text: mention JDK 21
- `README.md` / `IMPLEMENTATION.md`: JDK 21 next to Node 22 as a provisioned runtime
- Cross-link #9 for SDK / keystore (out of scope here)
---
## Out of scope
- Android SDK / `ANDROID_HOME` / build-tools 35 — #9
- Keystore / `keystore.properties` layout — #9
- Wiring `dta_webapp` / `chat_web_app` Gradle workflows
---
## Acceptance criteria
- [ ] `./scripts/provision.sh ai-server-4080` installs `openjdk-21-jdk` (or documented equivalent) with `javac` on `PATH`
- [ ] `JAVA_HOME` is `/usr/lib/jvm/java-21-openjdk-amd64` (or the distro JDK path) for the Act runner user
- [ ] `javac -version` reports 21 without using `~/.local/jdk/...`
- [ ] JRE-only packages are not the only Java install
- [ ] Provision docs list JDK 21 beside Node
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
./scripts/provision.sh/playbooks/site.ymlshould install a full JDK 21 (withjavac) and exportJAVA_HOMEso the self-hosted Gitea Act runner can compile Capacitor Android (AGP 8.7.2,JavaVersion.VERSION_21).Today provision installs Node (
roles/nodejs) but not Java. Android Gradle on the runner/control node fails because the OS Java is a JRE only.Related: #9 (Android CI toolchain — JDK was listed as 17+; Capacitor 7 needs 21). This ticket is the provision-step slice: apt JDK +
JAVA_HOME. SDK/keystore stay on #9.Triggered by dta_webapp#65 store AAB work (
ditch-the-agent/android).Current state (ai-server-4080 / runner host)
openjdk-21-jre+openjdk-21-jre-headlessonly — nojavacJAVA_HOMEwhich javacPATH/home/westfarn/.local/jdk/jdk-21.0.12+8/bin/javacexists but is not what Act/Gradle use~/Android/Sdkhas platform 35 (and 36.1); build-tools 34.0.0 + 36.0.0roles/commonbase packages have no JDK;site.ymlhas no jdk roleCapacitor writes
sourceCompatibility JavaVersion.VERSION_21inandroid/app/capacitor.build.gradle. JRE 21 is not enough; Gradle cannot compile.Work
1. Ansible role (provision)
Add a small role modeled on
roles/nodejs, applied fromplaybooks/site.yml(at least on ai-server-4080 /act_runner_enabled; installing on allwebserversis fine and cheap).Install JDK, not JRE:
Do not treat
openjdk-21-jreas sufficient.Optional:
openjdk-21-jdk-headlessif you want no GUI bits; still must includejavac.2. JAVA_HOME for Act jobs
Point the runner user and non-interactive CI shells at the distro JDK, e.g.:
Use
/etc/profile.d/java.shand/or/etc/environmentso Gitea Act (non-login) sees it. Do not rely on~/.local/jdk/jdk-21.0.12+8.3. Verify in the role
4. Docs
scripts/provision.shusage text: mention JDK 21README.md/IMPLEMENTATION.md: JDK 21 next to Node 22 as a provisioned runtimeOut of scope
ANDROID_HOME/ build-tools 35 — #9keystore.propertieslayout — Android CI/deploy support: JDK 17 + SDK 35 on runner, keystore secrets layout (#9)dta_webapp/chat_web_appGradle workflowsAcceptance criteria
./scripts/provision.sh ai-server-4080installsopenjdk-21-jdk(or documented equivalent) withjavaconPATHJAVA_HOMEis/usr/lib/jvm/java-21-openjdk-amd64(or the distro JDK path) for the Act runner userjavac -versionreports 21 without using~/.local/jdk/...