Ensuring the Correct Java Version is Installed
I recently finished some work where I rewrote an applet. The applet used to require only Java 1.1; however, because I used Swing instead of the AWT, Java 2 is required to run now. It will run under 1.4.2, but I am afraid that some customers might need to upgrade their Java installation. I found some articles on how to auto-install/update the JRE when launching JNLP applications. However, I would like to keep the applet in the browser, so using Web Start is not ideal.
Is there a way to check the version of java installed on a user's computer, and if it is not high enough, automatically download and install it?
If that isn't possible, is there a way to simply redirect them to the download page?
Thanks for the help. I am quite lost in all of this.
[783 byte] By [
geffdea] at [2007-11-27 11:34:04]

# 1
You can redirect them to the download page. Simply put a link below the applet that says "if the applet does not start, click here to get Java". Link it to the download page.
You can get the Java version, but if their version is older than the version you wrote your applet on then it won't be able to check. So checking can be done, but won't let you update.
Need more info?
# 2
I guess as much info as possible is great because, quite frankly, I haven't really done web stuff before. It seems like its all a great, big mess, and I'm quite confused.
Thank you very much.
# 3
Ok.
There is code you can write to check the version of java.
But this code won't work if the version of java they have is too old. If their version is too old then that code won't even be executed, and nothing you program into it will happen.
The applet simply will not start if their java is too old.