Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2007-10-13
3
Medium Priority
?
240 Views
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.
0
Comment
Question by:ebertk
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Bart Cremers earned 1500 total points
ID: 20074500
You should get there using something like this:

<html>
<script language="Javascript">

  var _app = navigator.appName;

  if (_app == 'Mozilla' || _app == 'Netscape') {
    document.write('<embed code="html.Test.class"',
                   'width="200"',
                   'height="200"',
                   'type="application/x-java-applet;version=1.6">');
    }
  else if (_app == 'Microsoft Internet Explorer') {
    document.write('<OBJECT ',
                   'classid="clsid:CAFEEFAC-0016-0000-FFFF-ABCDEFFEDCBA"',
                   'width="200"',
                   'height="200">',
                   '<PARAM name="code" value="html.Test.class">',
                   '</OBJECT>');
    }
  else {
    document.write('<p>Sorry, unsupported browser. (' + _app + ')</p>');
    }

</script>
</html>
0
 
LVL 13

Expert Comment

by:Bart Cremers
ID: 20074508
This specifies 1.6 is required for running the applet. Other minimum versions require other classid strings for IE
0
 
LVL 5

Author Comment

by:ebertk
ID: 20087134
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.

Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
Suggested Courses

810 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