Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is my app launched via webstart

 
Ronnie Phelps
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application that can be launched via webstart or outside of webstart. I know there is a way of checking whether the current application was launched via webstart or outside of webstart but I don't remember what the code looked like or where to find it. If anyone has an idea, let me knwo.
 
Sailaja Akkineni
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I hope this would help you.Check out this URL http://java.sun.com/products/javawebstart/faq.html#5
Sailaja
 
Smita Mangal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In the JNLP file u can provide the commandline arguments. And in the main method check the parameter, this way u can confirm the source of application whether via Java Web Start or not.
The arguments can be passed through JNLP file like:
<application-desc main-class="venus.Tool" />
<application-desc main-class="com.abc.MyClass">
<argument>-jconsole disable</argument>
<argument>show</argument>
</application-desc>
Hope this helps
Thanks
Smita
 
Ian Hand
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used a system property for this, this line in the resources section of my .jnlp:
<property name="webstart" value="true"/>
Then System.getProperty("webstart") will return the String "true" if you are running from web start, null otherwise. So your application can do:
if(System.getProperty("webstart") != null)
{
// web start specific behaviour
}
(you might want to check that the right value is returned, just in case someone else has set the system property.)
Dunno how robust this is, but hope it helps
[ October 16, 2003: Message edited by: Random Username ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic