Tinwor
Tinwor

Reputation: 7973

How can I get command line arguments from java equinox bundle?

I've an equinox application and I want get some eventual command line parameters that the user can use. How can I get these parameters?

Upvotes: 0

Views: 415

Answers (1)

Balazs Zsoldos
Balazs Zsoldos

Reputation: 6046

The list of possible arguments are listed in the EclipseLauncher class as constants. If you want, you can get the constants of the class with reflection. System property names are prefixed with "PROP_". This might work for one version, but not for other. I would not recommend this.

You can get the system properties via System.getProperties() (I guess this was trivial).

If you want to now if the arguments have been passed in Oracle based JVM with the sun.java.command system property. This will not work with other JVM implementations.

Non of the options above are suggested to use in production :). I would be interested in the use-case you want to implement by getting these arguments programmatically.

Upvotes: 1

Related Questions