简体   繁体   中英

How do I detect the OpenJDK in my applet (System Properties)?

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. !

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM