Java 19’s Architecture Win: The RISC-V Port

~
~
Published on
Authors
java-19-risc-v-port-banner

Java 19’s Architecture Win: The RISC-V Port

JEP 422 ports the JDK to Linux/RISC-V and landed in Java 19. The initial target is RV64GV (64-bit with vector), shipping the template interpreter, C1, and C2 JITs plus the major GCs (Epsilon, Serial, Parallel, G1, ZGC, Shenandoah). If you’re betting on open hardware, this widens your deployment surface without rewriting your stack. (OpenJDK)

Why RISC-V should be on a Java dev’s radar

RISC-V is an open instruction set architecture (ISA)—think “open source for CPUs.” Because the ISA is open, vendors and researchers can experiment, specialize, and ship silicon faster, often with sharper cost or power profiles. Bringing the JDK here means your Java skills ride the same hardware wave into dev boards, edge devices, and (increasingly) data-center SKUs. (RISC-V International)

What actually shipped in JEP 422

  • Scope: A full Linux/RISC-V port integrated into mainline OpenJDK.
  • ISA target: RV64GV (RV64 + IMAFD + V extensions).
  • Runtime: templateInterpreter, C1, C2; AOT/JVMCI excluded in the initial drop.
  • Garbage collectors: Epsilon, Serial, Parallel, G1, ZGC, Shenandoah.
  • Feature notes at launch: Vector/Foreign APIs were initially out of scope; check your vendor’s matrix for current status. (OpenJDK Bug Tracker)

Which Java versions (and who ships what)?

JEP 422 is part of JDK 19 and has since been backported or offered by vendors on other supported lines. A 2024 JCP briefing lists active vendor builds (e.g., Eclipse Temurin 21/22) and in-flight backports for 11 and 17 on riscv64. Always verify your vendor’s release notes for the exact features you need. (OpenJDK)

Bonus signal: broader platform momentum matters—e.g., Red Hat announced a RHEL for RISC-V developer preview in 2025, which helps the surrounding toolchain and packaging story. (Red Hat Developer)

Why this matters to teams

  • Portability with teeth. Java “write once” gets a new CPU family without application rewrites.
  • Open hardware synergy. OpenJDK on an open ISA gives long-term leverage vs. single-vendor lock-in.
  • Real experiments. With C1/C2 and modern GCs, you can do proper perf work on fresh silicon rather than toy builds. (OpenJDK Bug Tracker)

How to try it (fast path)

  1. Pick a vendor build for riscv64 Linux (e.g., check Eclipse Temurin/Red Hat notes).

  2. Install JDK 21+ (or 19 if that’s your baseline) on a riscv64 board, VM, or image.

  3. Smoke test:

    java -version
    
  4. Run two quick probes:

    • A CPU-bound microbenchmark (JMH) to exercise C2.
    • A GC-heavy workload to compare G1 vs. ZGC vs. Shenandoah pause/throughput behavior.
  5. Tooling: Maven/Gradle/JFR/JVMTI generally work; check your vendor’s notes for any bleeding-edge caveats. (Red Hat Docs)

Performance & limitations (real talk)

RISC-V silicon and toolchains are moving fast but are younger than x86_64/ARM64. The upside: the port includes tiered JITs and the modern GC lineup, so many server-style apps already run credibly; the caution: vectorization maturity and per-vendor tuning are still evolving—measure, don’t assume. For GC choices, start with G1 for balanced latency/throughput, try ZGC for ultra-low pauses at scale, and evaluate Shenandoah for consistently low pauses; then validate on your workload. (OpenJDK Bug Tracker)

Reference architecture sketch

  • OS: Linux (distro with riscv64 repos/images)

  • JDK: Vendor build for riscv64 (21 LTS recommended)

  • Runtime flags to explore:

    # Quick sanity runs
    java -XX:+UnlockExperimentalVMOptions \
         -Xms2g -Xmx2g \
         -XX:+UseG1GC -version
    
    # Swap collectors to compare:
    -XX:+UseZGC
    -XX:+UseShenandoahGC
    
  • Observability: Enable JFR for allocation/GC/JIT events; export to your usual APM.

FAQ

Is this just for embedded? No. RISC-V started in embedded, but vendor roadmaps now include higher-end parts. Pair that with a full JDK port and you get credible server experiments—provided your distro and hardware are ready. (jcp.org)

Do I have to change my build tooling? Generally no—Maven/Gradle builds targeting the same Java release should work. Watch native code, JNI, and vector/foreign APIs for architecture-specific bits. (OpenJDK Bug Tracker)

What’s the fastest GC here? There’s no universal winner. G1 is the safest default, ZGC shines for ultra-low pause large heaps, and Shenandoah aims for consistently low pauses. Benchmark with production-like heaps and traffic. (community.ibm.com)

The road ahead

As more boards and server SKUs arrive—and OS vendors expand support—Java “just working” on RISC-V unlocks deployments that optimize cost, power, or specialization rather than only chasing the biggest general-purpose cores. Keep your eye on vendor release notes and the OpenJDK RISC-V project feed for incremental feature parity and performance gains. (OpenJDK)

Further reading

  • JEP 422: Linux/RISC-V Port (official JEP). (OpenJDK)
  • Implementation ticket (what shipped: RV64GV, C1/C2, GC set, API caveats). (OpenJDK Bug Tracker)
  • JEP index confirms JEP 422 integrated in JDK 19. (OpenJDK)
  • Vendor ecosystem status (JCP briefing, 2024). (jcp.org)
  • Red Hat OpenJDK 21 release notes (RISC-V mention/links). (Red Hat Docs)

Call to action

Planning a platform experiment in the next quarter? Spin up a riscv64 environment, run your service with G1 → ZGC → Shenandoah, and post your latency/throughput deltas. If CPU choice became as flexible as your cloud region, how would you redesign your fleet?

WHy is this important?

Even if you never touch a RISC-V board today, JEP 422 gives you options—and options tend to pay off later. Here’s how it’s useful in practical, everyday dev life:

1) Future-proof your builds

Why: More clouds, distros, and vendors are adding RISC-V. When product or infra says “we’re testing cheaper/greener nodes,” you won’t be blocked.

Action: Add a riscv64 target to CI (cross-compile app; run unit tests on an emulated or hosted riscv64 runner).

2) Cost & power experiments (DevOps/SRE)

Why: Some teams chase lower cloud bills or power budgets. Open ISA + Java means you can A/B your same service on another CPU family.

Action: Benchmark the same JAR across x86_64/ARM64/RISC-V; compare p99 latency per watt.

3) Edge & embedded proofs of concept

Why: RISC-V dev boards are cheap and getting better. If your app can run there with G1/ZGC/Shenandoah, you unlock kiosk/IoT/edge pilots.

Action: Package your service as a fat JAR or container; deploy to a riscv64 board and validate memory/GC behavior.

4) Vendor flexibility (less lock-in)

Why: OpenJDK on an open ISA gives negotiation leverage and resilience if a vendor’s pricing or supply shifts.

Action: Keep architecture-specific bits (JNI/Vector/Foreign) isolated behind interfaces so swapping CPUs doesn’t touch core logic.

5) Better engineering instincts

Why: Running on a new architecture teaches you what really matters (allocation rate, GC pauses, profiling).

Action: Use JFR to watch allocation hot spots and JIT compilation phases; compare collectors:

quick collector swaps

java -XX:+UseG1GC -jar app.jar
java -XX:+UseZGC -jar app.jar
java -XX:+UseShenandoahGC -jar app.jar

6) Library & tooling validation

Why: “Works on my machine” becomes “works on multiple ISAs.” You’ll catch hidden native deps early.

Action: Add a lightweight arch matrix to CI for integration tests (x86_64, aarch64, riscv64).

7) Career signal

Why: Knowing how to run/profiling Java across ISAs is a standout skill for platform and performance roles.

Action: Write a short internal note or blog: “How our service behaves on RISC-V vs ARM64 (GC, JIT, footprint).”

8) When it might not matter (yet)

If you’re shipping a desktop app to a fixed platform and don’t touch infra costs, this is nice-to-know. Revisit when your org explores edge, sustainability targets, or new instance types.

  • Quick starter checklist (copy/paste)

  • Containerize the app (no native JNI first run).

  • Add riscv64 CI job: run unit + smoke tests.

  • Spin a riscv64 VM/board; confirm java -version.

  • Run JFR for 10–30 min under G1 → ZGC → Shenandoah.

  • Record: throughput, p95/p99, RSS, CPU%, and notes.

  • Share a 1-pager with results and next steps.

Bottom line: JEP 422 isn’t about shiny syntax; it’s about portability, price/perf experiments, and optionality. You don’t need it every day—but you’ll be glad it’s there the day your team needs a new lane.