Simon
Simon

Reputation: 4192

Check whether jar has been called by a JNLP file / Java Web Start

I have a JAR file which may be called manually or by Java Web Start / a JNLP file. Is there a possibility to check in the main method, how the JAR has been called?

Upvotes: 1

Views: 293

Answers (1)

Andrew Thompson
Andrew Thompson

Reputation: 168825

I can think of two ways. The app. was launched directly via. Jar. if:

  1. Add a property to the JNLP file, then check for it in main(). It will be null.
  2. Check for the existence of the JNLP API services. It is not possible to instantiate them in the normal way.

Upvotes: 1

Related Questions