How to get command line arguments of an Eclipse 4 application from code

e4, rcp

Solution

Since E4 is using Equinox as runtime you can use the Platform class to get the application arguments.

Platform.getApplicationArgs()

See Javadoc: http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Findex.html

Problem

I need to somehow get command line arguments of a running Eclipse 4 application. I'm working on a small application based on the Eclipse 4 RCP, but I thing, this problem is more common. I'm unable to find out, how to get from code of a product respectively of a plug-in the command line argumnets, the application have been executed with. I need to use a custom command line parameter to pass on information to my code. Do anybody know a hint?

Original source