Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Environment:A2aproject A2a java Java 17 Runtime

From Leeroopedia
Knowledge Sources
Domains Infrastructure, Java
Last Updated 2026-10-29 00:00 GMT

Overview

Java 17 (LTS) runtime environment required to build and run all A2A Java SDK modules, examples, and tests.

Description

The A2A Java SDK is compiled with Java 17 as the minimum release target. The parent POM's `maven-compiler-plugin` configuration sets `

17

`, `<target>17</target>`, and `<release>17</release>`, enforcing Java 17 bytecode across every module. The SDK makes extensive use of Java 17 features including `record` types for immutable protocol spec classes, sealed interfaces for the `ClientEvent` hierarchy, and pattern matching. Additionally, NullAway + JSpecify annotations are enforced via Error Prone at compile time, requiring the `--add-opens=java.base/java.lang=ALL-UNNAMED` JVM flag for the compiler fork.

Usage

This environment is the mandatory prerequisite for every implementation in the A2A Java SDK. Both client-side and server-side modules require Java 17 to compile and run. The reference servers (Quarkus-based) and all examples also target Java 17.

System Requirements

Category Requirement Notes
OS Linux, macOS, or Windows Any OS supporting JDK 17
Hardware 4GB RAM minimum 8GB recommended for full multi-module build with tests
Disk 2GB free space For Maven repository cache and build artifacts

Dependencies

System Packages

  • JDK 17 (LTS) — e.g., Eclipse Temurin 17, OpenJDK 17, Amazon Corretto 17
  • Maven 3.8+ (for building)

Build-Time Libraries

  • `maven-compiler-plugin` >= 3.16.0 (configured in parent POM)
  • `error-prone` = 2.50.0 (NullAway static analysis)
  • `nullaway` = 0.14.1 (null-safety checks)
  • `google-java-format` = 1.37.0 (via spotless plugin)
  • `jspecify` annotations (compile-time null-marking)

Credentials

No credentials required for the Java 17 runtime itself. Application-level credentials (API keys, OAuth tokens) are handled at the A2A protocol layer.

Quick Install

# Install JDK 17 (Ubuntu/Debian)
sudo apt install openjdk-17-jdk

# Verify
java -version
# Should output: openjdk version "17" or similar

# Maven (if not already installed)
sudo apt install maven
mvn --version

Code Evidence

Java 17 release enforcement from `pom.xml:449-455`:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>${maven-compiler-plugin.version}</version>
    <configuration>
        <source>17</source>
        <target>17</target>
        <release>17</release>
        <encoding>UTF-8</encoding>
        <fork>true</fork>
    </configuration>
</plugin>

JVM flag for compiler fork from `pom.xml:93`:

<quarkus.jvm.args>--add-opens=java.base/java.lang=ALL-UNNAMED</quarkus.jvm.args>

Example module also enforces Java 17 (`examples/cloud-deployment/server/pom.xml:110-113`):

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <release>17</release>
    </configuration>
</plugin>

Common Errors

Error Message Cause Solution
`java: compilation failed: release version 17 not supported` JDK < 17 installed Install JDK 17 and set `JAVA_HOME`
`class file version 61.0` / `UnsupportedClassVersionError` Running with JDK < 17 against compiled classes Ensure runtime JDK is 17+
`ErrorProne requires --add-opens` Missing JVM open-exports flag Set `quarkus.jvm.args` property in POM
NullAway compilation errors Missing `@Nullable` annotations on optional fields Add `@Nullable` from `org.jspecify.annotations`

Compatibility Notes

  • Java 21: Also supported (forward compatible). The SDK compiles and runs on JDK 21.
  • Java 11 and below: Not supported. Java 17 records and sealed interfaces are used throughout the spec module.
  • Android: Requires the separate `http-client-android` module with desugaring; Java 17 core APIs may not all be available.
  • GraalVM native image: Not the primary target; Quarkus native builds may require additional configuration.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment