jenv-gradle-low-ram

Align jenv to .java-version and run Gradle with low-memory flags.

51|6|Updated Mar 10, 2019
One-click install
npx skills add https://github.com/AniTrend/anitrend-v2 --skill jenv-gradle-low-ram
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jenv-gradle-low-ram
Source: https://github.com/AniTrend/anitrend-v2/tree/main/.agents/skills/jenv-gradle-low-ram
Command: npx skills add https://github.com/AniTrend/anitrend-v2 --skill jenv-gradle-low-ram

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents Gradle crashes and version-mismatch failures on low-RAM machines by ensuring the JVM used by ./gradlew matches the Java version pinned by .java-version, then applying memory-safe Gradle settings.

Core Features & Use Cases

  • Java version alignment: Sets jenv local to the exact version required by .java-version and verifies with java -version and ./gradlew -version.
  • Low-RAM Gradle execution profiles: Runs Gradle with --no-daemon, reduced --max-workers, and bounded JVM args (-Xmx, metaspace) to avoid OOM and daemon instability.
  • Fallback stabilization steps: Further reduces concurrency (--max-workers=1, disables parallel) and suggests Gradle properties for persistent safer defaults.

Quick Start

Run the debug build with the low-memory-safe profile by executing the provided ./gradlew --no-daemon --max-workers=2 command with the JVM args tuned for your RAM level.

Frequently Asked Questions about jenv-gradle-low-ram

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix Gradle out-of-memory crashes on a low-RAM machine?

To fix Gradle out-of-memory crashes on a low-RAM machine, execute tasks with memory-safe settings like --no-daemon, limited --max-workers, and bounded org.gradle.jvmargs to prevent daemon instability.

Why does my Gradle build fail due to Java version mismatch with .java-version?

Gradle builds fail due to Java version mismatch when the JVM used by ./gradlew does not match the .java-version file, requiring jenv local alignment and verification via java -version and ./gradlew -version.

What are the best Gradle JVM args and flags to prevent OOM errors during builds?

The best Gradle flags to prevent OOM errors include --no-daemon to disable background daemons, reducing --max-workers to limit concurrency, and configuring org.gradle.jvmargs with bounded -Xmx and metaspace limits.

How do I align jenv with my .java-version file before running Gradle tasks?

To align jenv with your .java-version file, run jenv local to set the exact required Java version, then verify the alignment was successful by checking the outputs of java -version and ./gradlew -version.

What should I do if Gradle builds still crash after limiting max-workers and JVM args?

If Gradle builds still crash after limiting JVM args, apply fallback stabilization by further reducing concurrency to --max-workers=1, disabling parallel execution, and setting persistent safer defaults in Gradle properties.