Share via


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

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

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

The Azure Command Launcher for Java is available for both x64 and arm64 Linux. The supported installation methods are:

Container images

The tool is included in the container images for the Microsoft Build of OpenJDK. No more setup is necessary.

For example, this Dockerfile uses jaz to run a Java application from a jar file:

# Use any Microsoft Build of OpenJDK base image
FROM mcr.microsoft.com/openjdk/jdk:25-ubuntu

# Add your application.jar
COPY application.jar /application.jar

# Use jaz to launch your Java application
CMD ["jaz", "-jar", "application.jar"]

Install on Azure Linux

Install the jaz package with the following command:

sudo tdnf install jaz

Install from the Linux Software Repository for Microsoft Products

If you've already set up the Linux Software Repository for Microsoft Products, run the appropriate package manager command for your distribution to install the jaz package.

Otherwise, find the instructions that match your Linux distribution in the following list. Follow the instructions, but install jaz instead of the msopenjdk-25 package.

Supported JVM versions

The Azure Command Launcher for Java supports OpenJDK-based builds, and has been tested with:

Configuration

The jaz command doesn't consume any command-line arguments for its own configuration. Instead, by default, it passes all arguments directly to the java command. To ensure that jaz configuration doesn't interfere with your application's arguments, jaz only accepts configuration via environment variables.

The jaz command can be configured using these environment variables:

Environment variable Description
JAZ_HELP Set to 1 to print a help message and exit with code 0.
JAZ_PRINT_VERSION Set to 1 to print the jaz version to stdout and exit with code 0.
JAZ_DRY_RUN Set to 1 to print the java command that would be executed and exit with code 1.
JAZ_BYPASS Set to 1 to bypass jaz optimization adjustments. No effect on telemetry.
JAZ_IGNORE_USER_TUNING Set to 1 to ignore all user-provided tuning flags and apply jaz tuning instead. Otherwise, jaz will only tune the JVM if it detects no user-provided tuning flags. See "What happens if I already set some JVM options in my environment?" for more information about how jaz behaves with and without enabling this setting.
JAZ_EXIT_WITHOUT_FLUSH Set to 1 to skip flushing telemetry on exit. This avoids potential delays (up to 30s) jaz might introduce while flushing data, however jaz might still send telemetry.

Using environment variables rather than command-line arguments also makes it easier to configure jaz in some cases. When deploying a containerized application, it's sometimes easier to set environment variables than modify launch scripts, and experimenting with JAZ_IGNORE_USER_TUNING and JAZ_BYPASS may be useful when evaluating jaz.

Roadmap

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

Changelog

Public preview 1: 0.0.0-preview+20251118.1

  • Implement RPM and DEB packages.
  • Improve garbage collector uncommit adjustments.
  • Stop emitting unclear diagnostic output when Java program exits with nonzero code.
  • Improve OS signal forwarding to Java process, for example, SIGTERM and SIGINT.
    • Stopping a container running a Java application now gives the application time to shut down gracefully.
  • Remove the use of PrintFlagsFinal, improving compatibility with certain Java applications.
    • Fix calls to System.console() throwing exceptions.
    • Fix stdout stream buffering: jaz no longer delays relaying output until it sees a newline character.
  • Other bug fixes and improvements to internal resilience.

Private preview 2

  • Bug fixes.
  • Expanded Linux distro compatibility by reducing glibc requirements.
  • jaz now detects if any manual JVM tuning is present and in such case, it doesn't apply its own adjustments.
  • JAZ_IGNORE_USER_TUNING=1 ignores manual JVM tuning if present, and applies jaz's own tuning adjustments instead.
  • Fixed PrintFlagsFinal output appearing (when not requested) if using jaz with OpenJDK HotSpot JVM 8.

Private preview 1

  • Initial release of Azure Command Launcher for Java.

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.