Skip to main content

On This Page

Java AI Agents: Build and Deploy with Google ADK 1.7 on Debian 13

2 min read
Share

These articles are AI-generated summaries. Please check the original sources for full details.

Build and Deploy Java AI Agents with Google ADK

The Google Agent Development Kit (ADK) for Java 1.7.0 now supports Java 25 and streaming function-call fixes. This tutorial demonstrates a complete agent with time and weather tools that runs locally and deploys to Cloud Run.

Why This Matters

The ideal of seamless AI agent deployment often clashes with messy authentication, fragile streaming, and outdated tooling. ADK for Java 1.7.0 addresses these with Java 25 support, fixed function-call reassembly, and daemon thread cleanup—eliminating the ‘JVM won’t exit’ problem. Without these improvements, developers waste hours debugging WebSocket origins or cross-user session leaks.

Key Insights

  • ADK for Java 1.7.0 (July 2026) includes Java 25 build support, more reliable streaming, and safer session handling.
  • The sample uses gemini-2.5-flash model as a stable baseline, while ADK 1.7 also supports Gemini 3 flow compatibility.
  • Function tools return structured maps with status and report fields, using IANA time zones and city aliases for Shanghai, Beijing, Mumbai.
  • Cloud Run deployment uses Vertex AI service identity, not local API keys, requiring IAM configuration for authenticated callers.
  • The project enforces Google Java Style via Checkstyle, with a lint target failing on warnings, suitable for CI pipelines.

Working Examples

Core agent definition using LlmAgent builder with two function tools.

public static final BaseAgent ROOT_AGENT = initAgent();
public static BaseAgent initAgent() {
    return LlmAgent.builder()
        .name("multi_tool_agent")
        .model("gemini-2.5-flash")
        .description("Agent to answer questions about the time and weather in a city.")
        .tools(
            FunctionTool.create(MultiToolAgent.class, "getCurrentTime"),
            FunctionTool.create(MultiToolAgent.class, "getWeather"))
        .build();
}

Maven dependencies pinned to ADK for Java 1.7.0, ensuring core and Dev UI versions match.

<properties>
    <google-adk.version>1.7.0</google-adk.version>
</properties>
<dependency>
    <groupId>com.google.adk</groupId>
    <artifactId>google-adk</artifactId>
    <version>${google-adk.version}</version>
</dependency>
<dependency>
    <groupId>com.google.adk</groupId>
    <artifactId>google-adk-dev</artifactId>
    <version>${google-adk.version}</version>
</dependency>

Practical Applications

  • Use case: Developers can build conversational agents with custom tools (time, weather) and test them via JUnit and ADK Dev UI. Pitfall: Relying on CORS defaults in production exposes the Dev UI; use Cloud Run IAM instead.
  • Use case: Multi-tool agents can be deployed to Cloud Run with a single command using source deployment and Dockerfile. Pitfall: Using a local API key in Cloud Run copies credentials into the service; prefer Vertex AI service identity.

References:

Continue reading

Next article

How a Solo Operator Runs a Full Company with Five Automation Primitives

Related Content