How can I force upgrade of Java if 1.3 or lower installed or the MS JVM is installed?

Posted on 2007-10-13
Last Modified: 2013-12-14
I have a series of Java applets that currently work with almost any version of Java 1.1 and higher.  This includes the MS JVM.  I am moving completely away from the MS JVM and the next version will not work with that version of Java (change is two fold:  1.  Migration due to end of life of MS  JVM  2. Begin using more advanced features not that the MS JVM is finally going away (kind of)).

I am looking for the best way to allow anyone using Java 1.3 or higher to use the APPLET and all lower versions, including the MS JVM to be required to upgrade.  Its important not to force an upgrade unless the apsolutely are 1.3 or lower.  We currently use the APPLET tag, would the OBJECT tag allow us to do this and if so how?  Any compability issues with older browsers or different operating systems?

Hoping we can do this all in HTML without having to add Java code into the applet itself.

THanks in advance.
Question by:ebertk
    LVL 13

    Accepted Solution

    You should get there using something like this:

    <script language="Javascript">

      var _app = navigator.appName;

      if (_app == 'Mozilla' || _app == 'Netscape') {
        document.write('<embed code="html.Test.class"',
      else if (_app == 'Microsoft Internet Explorer') {
        document.write('<OBJECT ',
                       '<PARAM name="code" value="html.Test.class">',
      else {
        document.write('<p>Sorry, unsupported browser. (' + _app + ')</p>');

    LVL 13

    Expert Comment

    This specifies 1.6 is required for running the applet. Other minimum versions require other classid strings for IE
    LVL 5

    Author Comment

    Bart CR, yes this does in fact work - but its kind of ugly and I have to list all my parameters twice 'we can have as many as 100 parameters for a single applet'.  Found another solution, where we only use the OBJECT tag and you conditionally insert the classid for IE.  Works a little better than your example, but your example helped me figure out how to do this.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    Bada platform is becoming more and more famous this days and people talking about same. Some friends included those who have bada OS mobile asked me "what is bada?"and "what its features?". That encouraged me to research and write this article. [st…
    Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
    THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
    This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now