(Ehum, cough, cough, ohh boy, I just hope no one pays attention to my incompetence.)
Sirs, thank you for your patience. Let's do some easy examples, and forget about everything else. I fully understand that the main class needs to have a main method to start the application. I have also read your manuals for the agent and the cli, so I quite know how to use them, but am a bit, maybe, confused, how the agent works.
I have a simple java application, HelloWorld.class which consists of a class and a main method that waits for an input:
System.out.println("Say something:");
System.console().readLine();
Normal scenario to invoke your agent would be java -javaagent:agent.jar=address=localhost,port=500,output=tcpserver HelloWorld
This will make a successful code coverage due to the application is constantly running until input.
Now, would the same scenario be possible without a java class? java -javaagent:agent.jar=[options]
Next example, to understand better with simple examples provided (and this does not mean that you have misunderstood me), if the above java application is already running without the agent, would it be possible to attach this agent to this application without providing any class? Or, when I start any java application, I also need to start the agent simultaneously with the application so he can listen on the ip and port, otherwise, he will not have any connection whatsoever to that simple application?
Please forgive me if I am just confusing everything, because personally I believe the agent simultaneously needs to be provided a class as an argument to the jvm (java -javaagent:agent.jar=[options] class).