this is a recurrent question. I've tried some of the alternatives comented above and more or less they do the work.
For me, as a Java developer use a JavaFX applet seems the best option. What I did is not to create a visual applet which still being so heavy and hard to integrate with the web design. But instead I've created a 1px applet which exports javascript privileged functions. http://docs.oracle.com/javase/tutorial/deployment/applet/invokingAppletMethodsFromJavaScript.html
Anyway you must sign the applet using a valid CA and even with that you will still having issues with some users, annoying messages because java not updated, installed jre 32bits but using 64 bits browser, some antivirus produce applets malfunctions, etc...
Also you can use this framework to create a plugin for firefox, chrome and IE http://www.firebreath.org/display/documentation/FireBreath+Home The installation is almost transparent for the user, that does not need to have anything more than a browser installed. The cons is that you need to implement it in C++ so it is up to you do cross platform plugins, of course you need compile it one version for each operating system you want to support. Firebreath provide some commons API's supported in majors SO.
Other option useful in some (not all) cases: You can create a systray desktop app that can do the privileged work. That app can start a tiny web server binded in the localhost interface, the browser can use cross domain ajax calls to communicate with the systray app and send instructions and updates to the web app.
Anyway be carefully implementing this kind of solutions, that requiere a bit effort to offer a good experience to the user.