with one click
jenv-gradle-low-ram
// Align jenv with .java-version and run Gradle reliably on low-RAM machines. Use for Java mismatch errors, Gradle OOMs, daemon memory pressure, and selecting safe build flags.
// Align jenv with .java-version and run Gradle reliably on low-RAM machines. Use for Java mismatch errors, Gradle OOMs, daemon memory pressure, and selecting safe build flags.
Understand and change android-emojify build logic, module dependencies, version catalog entries, Dokka setup, Spotless, and shared Gradle conventions. Use for buildSrc edits, new dependencies, module graph changes, or documentation pipeline work.
Write or improve KDoc for public APIs in android-emojify. Use for Dokka updates, class docs, function docs, property docs, consumer-facing documentation, and explaining how downstream apps should initialize or extend emoji library APIs.
Reference map for android-emojify modules, package roots, dependency direction, consumer entry points, and Dokka navigation. Use for questions like which module should own this code, where a class should live, what consumers should import, or how the library is organized.
| name | jenv-gradle-low-ram |
| description | Align jenv with .java-version and run Gradle reliably on low-RAM machines. Use for Java mismatch errors, Gradle OOMs, daemon memory pressure, and selecting safe build flags. |
| argument-hint | Describe your target task and available RAM, for example: assembleDebug on 8GB RAM |
java and Gradle use the Java version pinned by .java-version (21.0.8)../gradlew is about to be invoked in this repository..java-version is the active runtime for Gradle..java-version And jenv.java-version contains 21.0.8 and serves two purposes:
jenv reads this file to automatically switch to the correct JDK when you cd into the repository.actions/setup-java action uses it via java-version-file: '.java-version' in .github/actions/android/action.yml.jenv is not installed locally, the .java-version file has no effect and you must ensure JDK 21 is on your PATH manually.cat .java-version
jenv is installed and initialized.command -v jenv
jenv versions
jenv version
Decision point:
jenv is not found, install and initialize it in your shell startup (eval "$(jenv init -)").jenv is found but jenv version does not match .java-version, continue to step 3.required_java="$(cat .java-version)"
jenv local "$required_java"
Decision point:
jenv local fails because the version is missing, install JDK 21.0.8 and run jenv add <jdk-path>, then retry.java -version
./gradlew -version
Quality check:
./gradlew -version must match the major version from .java-version (21).Preferred one-off profile for assembling a library AAR:
./gradlew --no-daemon --max-workers=2 \
-Dorg.gradle.jvmargs="-Xmx1536m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
:emojify:assemble
For the full unit-test pipeline (must run in order):
./gradlew --no-daemon --max-workers=2 \
-Dorg.gradle.jvmargs="-Xmx1792m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
emojify:preTest
./gradlew --no-daemon --max-workers=2 \
-Dorg.gradle.jvmargs="-Xmx1792m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
emojify:test --stacktrace
./gradlew --no-daemon --max-workers=2 \
-Dorg.gradle.jvmargs="-Xmx1792m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
emojify:postTest
For Spotless check:
./gradlew --no-daemon --max-workers=2 \
-Dorg.gradle.jvmargs="-Xmx1536m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
spotlessCheck
./gradlew --no-daemon --max-workers=1 -Dorg.gradle.parallel=false :emojify:assemble
Suggested entries for ~/.gradle/gradle.properties:
org.gradle.daemon=false
org.gradle.parallel=false
org.gradle.workers.max=2
org.gradle.jvmargs=-Xmx1536m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8
jenv version correct but java -version wrong:
Ensure shell init runs eval "$(jenv init -)" and enable the export plugin with jenv enable-plugin export.Gradle daemon disappeared unexpectedly:
Retry with --no-daemon --max-workers=1 and lower -Xmx if the OS is reclaiming memory aggressively.:emojify:assemble) instead of full-project builds.emojify:test fails with missing emoji fixture:
Always run emojify:preTest before emojify:test. The fixture is not committed to test resources..java-version and jenv version resolve to the same Java release (21.0.8)../gradlew -version reports JVM 21..java-version and run the emojify test pipeline with 8GB RAM"