Reputation: 119
Is it possible to get full command line with all arguments which was used to launch current Java process and to get that during OnLoad phase in JVMTI?
Upvotes: 4
Views: 259
Reputation: 1133
Its not possible to get the pull path but on Oracle JVMs you could use
char * res;
jvmti->GetSystemProperty("sun.java.command", &res);
to get the main class and arguments.
You can use java.class.path too, so with both you can discover quite a lot about how the command started.
Upvotes: 0
Reputation: 29513
I have consulted the JVMTI reference and I think that it is not natively provided, I guess your best shot is to use Byte Code Instrumentation (BCI).
Upvotes: 1