views:

93

answers:

1

How can I determine if my client is running OpenJDK with a web plugin? I've tried java.version and the rest of the properties listed here.

Running java -version from the terminal works fine, but if I went this route, java would have to be on the user's path, which I don't know if I can trust entirely. Is there any other way to see the string given by java -version programmatically, without shelling out to the command line or terminal?

Right now, when I run System.getProperties().getProperty("java.version"), I get Sun Microsystems Inc.!

A: 

You can't do it via system properties, but firefox provides a navigator.plugins array containing all installed plugins. If you check the "name" property of each plugin, you should be able to separate the Sun Java plugin from imitators.

Stefan Kendall