Question: Is there a reliable way of detecting what version of Java is installed on the client's machine using JavaScript?

Answer: 
The detection logic does not work in IE32 on Windows7-64. It could not detect the java version it installed earlier. 

Well, after further reading, the Java Deployment Toolkit on Windows uses ActiveX classid which may pose your app to hackers (see <http://www.kb.cert.org/vuls/id/886582>). I am out.
If you use Google Analytics, [this post](http://cowwoc.blogspot.com/2008/12/tracking-java-versions-using-google.html) might be helpful (see the [forum thread](http://forums.java.net/jive/thread.jspa?threadID=53140&tstart=15) for more details).