Skip to main content

What version of Java are you running?

Posted by malcolmdavis on March 27, 2010 at 2:51 PM PDT

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

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:

deployJava.js is used for other things such as enhancing google analytics tracking of Java:


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.



      <script src=""></script>



<div id="dcontent" style="width:100%; background-color: #E2E2FC; padding-left: 5px"></div>

<script type="text/javascript">


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=""></a></p>'

function altercontent(){

    if( deployJava.versionCheck("1.7")==false ) {

        if (document.all) {


        } else if (document.getElementById){

            rng = document.createRange();

            el = document.getElementById("dcontent");


            htmlFrag = rng.createContextualFragment(java_message);

            while (el.hasChildNodes()) {












A future message for Java 7:




Related Topics >>