Related to an existing integration?
Yes
Existing integration
Java
Overview
AddJavaApp does not currently support passing JVM arguments to executable Java apps.
Usage example
var builder = DistributedApplication.CreateBuilder(args);
builder.AddJavaApp("app", workingDirectory: "./app",
new JavaAppExecutableResourceOptions
{
ApplicationName = "app.jar",
OtelAgentPath = "./agents",
JvmArgs = ["-Darg=value"]
})
The only new part here is the additional JvmArgs property.
Breaking change?
No
Alternatives
The only workaround I can think of at the moment is to build a container image for my application which sets the JVM arguments. For example:
# Dockerfile
ENV JAVA_OPTS=""
ENTRYPOINT [ "java", "$JAVA_OPTS", "-jar", "app.jar"]
// AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
builder.AddJavaApp(
"containerapp",
new JavaAppContainerResourceOptions
{
ContainerImageName = "registry/app:latest",
OtelAgentPath = "./agents"
})
.WithEnvironment("JAVA_OPTS", "-Darg=value");
Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item
Related to an existing integration?
Yes
Existing integration
Java
Overview
AddJavaAppdoes not currently support passing JVM arguments to executable Java apps.Usage example
The only new part here is the additional
JvmArgsproperty.Breaking change?
No
Alternatives
The only workaround I can think of at the moment is to build a container image for my application which sets the JVM arguments. For example:
Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item