Is it still possible to start a 'native' application under windows via a java applet in a browser? IE "Click here to start notepad.exe" on a web page. The most recent reference I could find for this was dated 2002. Im wondering if this model / concept is no longer supported.
-
2did you try the approach you found? did it work?Mat– Mat2011-06-02 14:44:55 +00:00Commented Jun 2, 2011 at 14:44
-
Its so old that some of the packages aren't available anymore. Getting it to build was beyond me.ethrbunny– ethrbunny2011-06-02 14:46:28 +00:00Commented Jun 2, 2011 at 14:46
-
here is an IE solution: codereflex.net/how-to-run-exe-on-webpage --> I need something browser neutral though.ethrbunny– ethrbunny2011-06-02 14:50:53 +00:00Commented Jun 2, 2011 at 14:50
-
1Java can certainly do it.. now I just need to remember how to write an applet..ethrbunny– ethrbunny2011-06-02 14:59:53 +00:00Commented Jun 2, 2011 at 14:59
3 Answers
Yes, but the applet has to be signed.
Signed applets will prompt the user to give them permission. Once given, the applet has the same rights as any application running on the machine, including the ability to launch native apps (or link native libraries, which I've had to do in the past).
3 Comments
..Is it still possible to start a 'native' application under windows via a java applet in a browser?
Sure thing. As mentioned in other replies, a signed (and trusted) applet can use Runtime.exec(String) to launch a native application.
As of Java 1.6, it becomes simpler with the implementation of Dekstop.getDesktop.open(File), which will open the selected File with whatever application the OS has registered as a consumer for that file type.
As of Sun's Plugin2 architecture (1.6.0_10+ in a Sun/Oracle JRE) offers a more generic method for an (sand-boxed) applet embedded in a web page, using the JNLP API's BasicService. Here is my demo. of the BasicService
4 Comments
Desktop class.file: URL to run a local application?BasicService can be used to launch JWS based desktop applications.