Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JRE not installed on client system

 
Sunil Kumar Gupta
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.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • 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
 
Lanny Gilbert
Ranch Hand
Posts: 129
  • 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.
 
Dave Robbins
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic