Skip to content

compatible different command line style for find jar path #12545

@misaya98

Description

@misaya98

Describe the bug

compatible command like : java -jar -XX:MaxRAM=128m app.jar
The JAR file name does not always come immediately after the -jar command; there may be other JVM parameters in between the two.

by now, if we use the java -jar -XX:MaxRAM=128m app.jar command to start the applicaion. we can not get the real jar name.
we will get the warn log like below:
otel.javaagent 2024-10-29 09:24:19:600 +0000] [main] WARN io.opentelemetry.instrumentation.resources.ManifestResourceProvider - Error reading manifest java.nio.file.NoSuchFileException: -XX:MaxRAM=128m

Steps to reproduce

start application by java -jar -XX:MaxRAM=128m app.jar

Expected behavior

get the real jar name

Actual behavior

can not get jar name

Javaagent or library instrumentation version

latest

Environment

JDK: 17
OS: redhatLinux

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds triageNew issue that requires triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions