Link to home
Start Free TrialLog in
Avatar of brianrandy
brianrandy

asked on

Auto Detect and Install Java VM

I need to auto detect for the latest version of java (or java vm or jre) so that users can run an applet.  If java is not enabled, installed or running it should open the java.com page in a new window that will then install the latest version of java.

I just need the exact code required to do this.  I have read about using the object tag and some other ideas but the exact code for html is what I need.  Also, this code should work on all browsers and OS.  I am sure this has been done before but I having trouble finding the exact answer.  

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Zyloch
Zyloch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Also, one more thing. I noticed that above, I typed:

var width=screen.width;
var height=screen.height;

You may wish to change it to:

var width=screen.width;
var height=screen.height-40;

Otherwise, the browser may obscure the Start Menu.

Another change you MAY want to change is where I typed:

newWin = window.open('http://java.sun.com/j2se/1.4.2/download.html','newWind', 'toolbar=yes,location=yes,scrollbars=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes,width='+width+',height='+height);

You may wish to add this to right after copyhistory=yes:

...ubar=yes,copyhistory=yes,resizable=yes,width='...

The resizable allows the browser to be resized.

I hope this supplementary post helps.

Finally, I would like to point out a problem with the above method:

If your users have a popup blocker, you may have to also warn them on the page to disable it.

Mozilla Firefox v0.8, I know for a fact, suppresses popups automatically. To stop that, tell your Mozilla Firefox visitors to go to

Tools -> Options
Click on Web Features in Menu at left.
Uncheck the Block Popups checkbox.
Click Ok.

The above script has been tested in Netscape, Internet Explorer, Mozilla Firefox, and Opera. All seem to work fine.