1

Can someone explain what is the use of the -agentlib option and its internal working.

To give a broader perspective I am running the below command:

java -agentlib:TakipiAgent MyClass

And it is giving me the error:

Could not find agent library TakipiAgent on the library path, with error: libTakipiAgent.so: cannot open shared object file: No such file or directory

N.B - This seeks answer to both: 1)the working of -agentlib in general (2) possible solution to the error I am getting

DockYard
  • 989
  • 2
  • 12
  • 29
  • You checked the documentation, right? What did it say? What is confusing you about what it said? – Michael Apr 05 '21 at 14:15
  • @Michael Yes I did check the docs. I got to know, if -agentlib:foo is passed, then the the library libfoo.so will be loaded from the location mentioned in LD_LIBRARY_PATH system variable. Now my problem is, my command working fine in 1 VM, and not working fine in another VM. In both the VMs, LD_LIBRARY_PATH is not set. How is it working then internally? Is there any other switch that overrides this LD_LIBRARY_PATH? Or am I missing some thing? These questions are the reasons why I asked a generic answer about the -agentlib switch, instead of just copy pasting my error here. – DockYard Apr 05 '21 at 14:52

0 Answers0