What version of Java are you running?
There can be issues promoting Java applications over the Internet. There are various versions of Windows and Windows Server that run pre-6 Java, or even Microsoft Java Virtual Machine.
Verifying the version of Java on someone machine is a good way of eliminating a potential problem.
Michael Horowitz sponsors the embedded applet approach at http://www.javatester.org/version.html
However, there are several issues with the embedded applet approach. One problem deals with the IE 8 browser. IE is still not entirely Java friendly, IE sometimes just decides to play dead when loading a page with a Java applet.
Sun/Oracle provides a Deployment Toolkit Script called deployJava.js. More about the deployJava.js script and usage can be found at: http://java.sun.com/javase/6/docs/technotes/guides/jweb/deployment_advic...
deployJava.js is used for other things such as enhancing google analytics tracking of Java: http://cowwoc.blogspot.com/2008/12/tracking-java-versions-using-google.html
The following script will check and see if the proper version of Java is installed and will display a message if not the proper version is not installed.
<html><br />
<head><br />
<script src="http://java.com/js/deployJava.js"></script><br />
</head><br />
<body><br />
<div id="dcontent" style="width:100%; background-color: #E2E2FC; padding-left: 5px"></div><br />
<br />
<script type="text/javascript"><br />
deployJava.do_initialize();<br />
var java_message =' <p><h2>Product XYZ requires Java</h2><p>Invalid version of Java. XYZ requires Java 7 or higher. You can download and install Java from <a target="_blank" href="http://java.com">www.java.com</a></p>'<br />
function altercontent(){<br />
if( deployJava.versionCheck("1.7")==false ) {<br />
if (document.all) {<br />
dcontent.innerHTML=java_message;<br />
} else if (document.getElementById){<br />
rng = document.createRange();<br />
el = document.getElementById("dcontent");<br />
rng.setStartBefore(el);<br />
htmlFrag = rng.createContextualFragment(java_message);<br />
while (el.hasChildNodes()) {<br />
el.removeChild(el.lastChild);<br />
}<br />
el.appendChild(htmlFrag);}<br />
}<br />
}<br />
window.onload=altercontent<br />
</script><br />
</body><br />
</html><br />
Sample
A future message for Java 7:
<script src="http://java.com/js/deployJava.js"></script>
- Login or register to post comments
- Printer-friendly version
- malcolmdavis's blog
- 2582 reads





