In Java, is there a way to obtain the command line parameters even if main() didn't save them?

Posted by Uri on Stack Overflow See other posts from Stack Overflow or by Uri
Published on 2009-06-29T14:11:07Z Indexed on 2010/04/09 9:33 UTC
Read the original article Hit count: 284

We have a program with a main() that parses certain CLPs but does not save them anywhere. I then have my own plug-in code that needs access to the original CLPs (so I can transmit more parameters) for it. However, I cannot change main()

I saw that there is apparently a way to do this in C#, I'm looking for an equivalent Java solution on Linux.

UPDATE: Obviously, I'm aware of how main() works. Unfortunately, I cannot change the existing application or the way it is invoked (except for CLPs). I can only access via a sandboxed plugin code. My question is whether there is a way to get the command line (rather then the environment variables with -D) that the JVM was invoked with.

© Stack Overflow or respective owner

Related posts about java

Related posts about command-line-arguments