I tried this suggestion, creating the JavaAgent.class and putting it in agent.jar
The pertinent parts of the manifest are:
Manifest-Version: 1.0
...
Specification-Version: 1.0.0
...
Premain-Class: de.cmsol.agent.JavaAgent
I use Eclipse and the VM argument list was set to:
-javaagent:agent.jar
...
Still the VM doesn't start. I get the exception:
java.net.SocketException: socket closed
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
at java.net.ServerSocket.implAccept(ServerSocket.java:453)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at org.eclipse.jdi.internal.connect.SocketTransportService.accept(SocketTransportService.java:95)
at org.eclipse.jdi.internal.connect.SocketTransportImpl.accept(SocketTransportImpl.java:56)
at org.eclipse.jdi.internal.connect.SocketListeningConnectorImpl.accept(SocketListeningConnectorImpl.java:135)
at org.eclipse.jdt.internal.launching.StandardVMDebugger$ConnectRunnable.run(StandardVMDebugger.java:107)
at java.lang.Thread.run(Thread.java:619)
What am I doiing wrong?