Using the GitHub Copilot SDK for Java
Aug 10, 2026Edward Burns

Summary
This post introduces the GitHub Copilot SDK for Java, a framework-agnostic client library that allows server-side Java code to programmatically create Copilot agent sessions, register tools using annotations or lambdas, send prompts, and receive structured responses. It highlights the use of virtual threads for efficient agent processing and real-time UI updates via WebSockets. The post details the SDK's features, including `@CopilotTool` and `@CopilotToolParam` for defining tools, `ToolDefinition.from(...)` for inline lambda tools, cross-class tool scanning, customization of system messages, and the `sendAndWait(...)` method for the agentic loop. A sample Jakarta EE 11 application is provided to demonstrate these capabilities.
More from the AI-Assisted Code Development and Review trail
- How we make AI coding more cost efficient without sacrificing task quality
- Turn one giant AI-generated pull request to a reviewable stack
- The cost of saying yes has changed
- Better tools made Copilot code review worse. Here's how we actually improved it.
- Agent-driven development in Copilot Applied Science