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

Answer: 
Check out the code in the [Java Deployment Toolkit](http://docs.oracle.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html#deplToolkit).
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).