How to provide jar as javaagent in properties file?

635 views Asked by At

I have a maven repository known as jolokia-jvm.jar. I need to put this as a -javaagent in the properties file, as follows:

 AppName.JAVA_MEM=-Xms500M -Xmx500M -XX:MaxPermSize=128m -javaagent:jolokia-jvm-1.2.3.jar=port=9001,host=*

I have downloaded the jvm from maven repository. How can I do that?

        <!--Jolokia jvm-->
        <dependency>
            <groupId>org.jolokia</groupId>
            <artifactId>jolokia-jvm</artifactId>
            <version>1.2.3</version>
        </dependency>
1

There are 1 answers

0
Fob On

Use dependency:

<dependency>
        <groupId>org.jolokia</groupId>
        <artifactId>jolokia-jvm</artifactId>
        <version>1.2.3</version>
        <classifier>agent</classifier>
</dependency>

and -javaagent:jolokia-jvm-1.2.3-agent.jar=port=9001 option