Signed-off-by: Goran Draganić <goran@daytona.io> Signed-off-by: MDzaja <mirkodzaja0@gmail.com>
1.1 KiB
1.1 KiB
Java SDK Examples
This directory contains example projects demonstrating how to use the Daytona Java SDK.
Prerequisites
-
Environment Variables - Configure your API credentials:
export DAYTONA_API_KEY="your-api-key" export DAYTONA_API_URL="https://app.daytona.io/api" # optional, this is the default export DAYTONA_TARGET="us" # optional -
Java - Ensure JDK 11+ is installed (the devcontainer includes JDK 21)
Running Examples
examples/java/gradlew -p examples/java/<example-name> run
For example:
examples/java/gradlew -p examples/java/lifecycle run
examples/java/gradlew -p examples/java/exec-command run
examples/java/gradlew -p examples/java/file-operations run
How It Works
Each example is a standalone Gradle project. The shared Gradle wrapper (gradlew) in this directory handles downloading Gradle and building examples.
Examples resolve the SDK from source via Gradle composite builds — any changes you make to the SDK or API clients in libs/ are reflected immediately without any install or publish step.