The JVM parameter agentlib is used primarily to mount local library packages.
Starting from JDK 1.5
An example to run Java Debug Wire Protocol (JDWP) which is mainly for debugging your Java project:
java -agentlib:jdwp[=options] MainClass
You can use it with different libraries, such as HPROF (A Heap/CPU Profiling Tool) with the command:
java -agentlib:hprof[=options] ToBeProfiledClass
“agentlib” was introduced in Java 1.5 to allow you to load a library. It looks up the library depending on each running platform. Generally, the “lib-name” in the syntax is expanded to an operating system specific file name and the [options], which can be optional for some libraries, will be passed to the given agent on start-up. For example, if the option -agentlib:name is specified, the virtual machine will attempt to load the shared library name.dll from the system PATH under Windows or libname.so from the LD_LIBRARY_PATH under the Solaris operating environment.
The default is an empty library.
The library should exist in the PATH under Windows or LD_LIBRARY_PATH under the Solaris operating environment.