Azure Command Launcher for Java (public preview)

The Azure Command Launcher for Java (jaz) is a lightweight utility that simplifies how Java developers run their applications on Azure. By intelligently applying Java Virtual Machine (JVM) options tailored for cloud environments, the tool reduces configuration overhead and improves resource utilization out of the box, with higher potential for better performance.

This tool is ideal for developers who:

  • Want better JVM defaults without diving deeply into tuning guides.
  • Develop and deploy cloud native microservices with frameworks like Spring Boot, Quarkus, or Micronaut.
  • Prefer container-based workflows such as Kubernetes and OpenShift.
  • Deploy Java workloads on Azure Container Apps, Azure Kubernetes Service, Azure Red Hat OpenShift, or Azure Virtual Machines.

Key features

  • πŸ›  Automatically tunes JVM flags for cloud-native deployments.
  • πŸš€ Plug-and-play experience. Just drop into your Dockerfile or launch script, replacing the java command with jaz.
  • ☁️ Optimized for Azure environments.
  • πŸ”§ Customizable via environment variables. There are several ways to safely roll out configuration changes.

Supported environments

The Azure Command Launcher for Java can be used wherever the Java launcher is available in Linux-based environments. It has been validated and tested across the following Azure and CI/CD platforms:

  • Azure Kubernetes Service (AKS)
  • Azure Container Apps
  • Azure App Service
  • Azure Functions
  • Azure Red Hat OpenShift (ARO)
  • Azure Virtual Machines
  • Azure DevOps
  • GitHub Codespaces
  • GitHub Actions

Important

The Azure Command Launcher for Java reads cgroup v1 and v2 information to determine the available resources and tune the JVM accordingly. It probes the files within /sys/fs/cgroup to discover memory limits and other resource constraints.

If the cgroup filesystem isn't mounted at /sys/fs/cgroup, the Azure Command Launcher for Java might not detect containerization limits correctly, leading to poor performance or even out-of-memory errors. We haven't identified a scenario in any of the supported environments where this is a concern, but it might be possible to encounter this limitation in customized environments.

For more information, see "Why does my cgroup mount point matter?".

Public preview

The Azure Command Launcher for Java is now available in public preview! Read the public preview announcement for an introduction to this tool and its benefits.

How it works

The Azure Command Launcher for Java sits between your container or virtual machine startup command and the JVM. When you launch the tool, it:

  1. Detects the cloud environment (for example, container limits and available memory).
  2. Analyzes the workload type and selects best-fit JVM tuning flags, such as:
    • Heap sizing.
    • Garbage collector selection and tuning.
    • Logging and diagnostics settings as needed.
  3. Launches a Java process, passing it the tuning flags and any user-provided arguments.
  4. Invisibly relays stdout, stderr, stdin, and OS signals to and from the Java process.
  5. Monitors the Java process and relays its exit code when it terminates.

Example usage

The Azure Command Launcher for Java is a drop-in replacement for the java command, requiring no code changes. Simply replace java with jaz in your launch scriptsβ€”for example, replace java -jar foo.jar with jaz -jar foo.jar.

Instead of tuning your JVM options manually:

JAVA_OPTS="-XX:... several JVM tuning flags"
java $JAVA_OPTS -jar myapp.jar

Use jaz:

jaz -jar myapp.jar

By default, jaz applies its tuning when it does not detect any user-provided tuning flags. If the Java command-line arguments or Java option environment variables already include user-provided tuning flags (such as -X* or -XX*), jaz keeps those settings and doesn't add its own. To force jaz to apply its tuning (without removing user-provided tuning flags), set JAZ_IGNORE_USER_TUNING=1.

Your application might automatically benefit from:

  • Battle-tested defaults for cloud native and container workloads.
  • Reduced memory waste in the cloud.
  • Better startup and warmup performance.

Installation

For instructions on how to install the Azure Command Launcher for Java on Linux, or how to install container images, see the Installation page.

Roadmap

  • βš™οΈ JVM configuration profiles
  • πŸ“¦ AppCDS support
  • πŸ”„ Continuous tuning
  • πŸ“Š Telemetry
  • πŸ“¦ Leyden support

Changelog

You can find the Azure Command Launcher for Java release notes and changelog on the Azure Command Launcher for Java releases page.

Telemetry

Azure Command Launcher for Java collects usage data and sends it to Microsoft to help improve our products and services. To learn more, read our privacy statement.