Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JRE not installed on client system

 
Ranch Hand
Posts: 824
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way to know that client system does not have JRE installed , when applet tries to execute on the client side.
And when this conditions occurs ,How We can show the message in that html page that please install JRE from here or so.
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a good article on how to detect plugins here. It doesn't deal with applets as it is, but the code could be easily extended to check for that. The mechanism discussed there requires JavaScript, though.

Even easier would be to use "alternate HTML" in the applet tag, which is discussed here.
 
Sunil Kumar Gupta
Ranch Hand
Posts: 824
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I really missed that ALT attribute in java tutorials
 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even better is to do this. This code looks for 1.4.2_10 to be installed on a user's machine and installs it if it's not there. Also, even if the user has a different default JVM inside of Internet Explorer, the applet will use the JRE you specify.

+++++++++++

<OBJECT classid="clsid:CAFEEFAC-0014-0002-0010-ABCDEFFEDCBA"
width="950" height="595" align="baseline"
codebase="http://java.sun.com/update/1.4.2/jinstall-1_4_2_10-windows-i586.cab">;
<NOEMBED><XMP>

<APPLET code="<path to your file>.class" align="baseline"
width="960" height="595">
</XMP>
<PARAM NAME="java_code" VALUE="<path to your file>.class">
<PARAM NAME="java_type" VALUE="application/x-java-applet;jpi-version=1.4.2,10">
<PARAM NAME="scriptable" VALUE="true">
<PARAM name="name" value="<applet-name>">
<PARAM name="id" value="<applet-id>">


<PARAM name="archive" value="<jars needed for your applet to run, comman separated>"
No Java 2 SDK, Standard Edition v 1.4.2_10 support for APPLET!!

</APPLET></NOEMBED>
</OBJECT>

+++++++++++++++++++++++++++



You can substitute other JREs for 1.4.2_10. This is just an example.
 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there is a tool called "htmlconverter" bundled with the JDK that will convert "ordinary" applet tags to the form Lanny showed you

Dave
 
Something about .... going for a swim. With this tiny ad ...
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic