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.
If you don't mind using a basic java applet that requires a much older version to run, you could use this article and continue based on that result.
The link below was the way I got it to work. It has a JS you can get which was made for Java deployment. The link was mentioned above, but I thought an example with it would be nice.
These are samples that I ended up needing to fix my problem.
http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/technotes/guides/jweb/deployment_advice.html#deplToolkit
Once you have downloaded the deployJava.js file you could put something to make sure java is installed:
if (deployJava.getJREs().length > 0) { //Your code to start java }
Make sure a specific version is installed:
if (deployJava.versionCheck(version)) { //Your version specific code }
Start the installer of the latest Java:
deployJava.installLatestJava();
Or a specific version if you would like:
deployJava.installJRE(version);
The link below details on the deployment tips for java apps.
http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html
Quoting from the link
Use deployJava.js function getJREs() to build a dynamic page depending on the user's Java version.
Use http://cowwoc.blogspot.com/2008/12/tracking-java-versions-using-google.html to track the Java version being used by your web visitors using Google Analytics.
Bonus step: use the source-code from step 2 as an example of how step 1 should be implemented.
Just copy amd paste this code in your browser address bar! Check if it is useful for you.
You need to obtain the position of Java in the plugins array and maybe you can check the versions with a regular expression or something. You could take a look to the plugin javascript object.
Regards!
Maybe this script will help. This is Windows-only, though.