How can I detect the Java runtime installed on a client from an ASP .NET website?

Carl picture Carl · Jan 29, 2009 · Viewed 12.4k times · Source

I have an ASP .NET website that hosts a Java applet. The Java applet requires version 1.6 Update 11 of the Java runtime.

How can I detect that a client has the appropriate runtime installed so that I can display an informative message if they do not?

Thanks,

Carl.

EDIT: The solution must be platform independant.

Answer

Andreas Grech picture Andreas Grech · Jan 29, 2009

This page describes how to and lists some plugins that will allow you to detect Java with JavaScript: http://www.pinlady.net/PluginDetect/JavaDetect.htm

Other than that, try out this snippet as well:

if (navigator.javaEnabled()) {
    //Java is enabled
}