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.
Use when mapping SQLite query behavior, Room raw query integration, annotation processing flow, or current KSP code-generation behavior in support-query-builder.
Understand and change support-query-builder build logic, module dependencies, version catalog entries, Dokka setup, KSP wiring, and shared Gradle conventions. Use for buildSrc edits, new dependencies, module graph changes, or publishing pipeline work.
Reference map for support-query-builder 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.
Write or improve KDoc for public APIs in support-query-builder. Use for Dokka updates, class docs, function docs, property docs, consumer-facing documentation, and explaining how downstream apps should use or extend library APIs.
| 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../gradlew is about to be invoked in this repository..java-version is the active runtime for Gradle.cat .java-version
The expected output is 21.0.8. Systems in this project are expected to have jenv installed; the .java-version file is read by jenv local to pin the active JDK for the working directory.
jenv is installed and initialized.command -v jenv
jenv versions
jenv version
Decision point:
jenv is not found, install it from https://github.com/jenv/jenv and run eval "$(jenv init -)" in your shell startup, then re-open the shell and retry.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 that JDK and run jenv add <jdk-path>, then retry.java -version
./gradlew -version
Quality check:
./gradlew -version must match .java-version major version (21).Preferred one-off profile for building a debug variant:
./gradlew --no-daemon --max-workers=2 \
-Dorg.gradle.jvmargs="-Xmx1536m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
:core:assembleDebug
For running unit tests:
./gradlew --no-daemon --max-workers=2 \
-Dorg.gradle.jvmargs="-Xmx1792m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
:core:test :processor:test
For running all tests across modules:
./gradlew --no-daemon --max-workers=2 \
-Dorg.gradle.jvmargs="-Xmx1792m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8" \
test
./gradlew --no-daemon --max-workers=1 -Dorg.gradle.parallel=false :core:test
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 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.:core:test or :processor:test) instead of full-project builds.:processor module):
Keep worker pressure low (--max-workers=1 or 2) and run :processor:test directly before full-project tasks..java-version and jenv version resolve to the same Java release (21.0.8)../gradlew -version reports the expected JVM (major version 21)..java-version and run debug build with 8GB RAM settings"