I am working on web app with jquery, jqueryui, ajaxify and many jquery extensions.
At some point in the application I have to use Java applet.
The applet is run via ajax call, let’s say jquery.load loads a page that generates applet code. I would like then to detect if Java is installed on the computer running the app, and if it is version 1.7+. The detection should occur only if applet is going to be used, since this functionality is to be used by limited number of users and only in certain circumstances.
I can’t use deploy.js, as this script was not designed to be run via ajax call and simply fails.
I would like to detect java only when it it really needed, i.e. when user is going to launch the applet.
How can I do that?
I will appreciate your help.
Finally I found a way to detect if java is installed.
At first I tried with navigator.javaEnabled(), but it didn’t work properly with IE.
Then I tried Java deployment toolkit, but didn’t succeed due to window.write which was not compatible with pages fetched via ajax.
Then I tried to customize Java deployment toolkit following odiszapc advice … but by the end of the day I used unmodified Java development toolkit, simply I used its versionCheck method.
If java is not detected, the user is told to download and install JRE, and link is provided.
If correct version of Java is installed then the subpage is reloaded via ajax with parameter javaOK=1. In such a case there is no java detection, just pure applet tags, in short: