If I compile my applet using JDK1.5 then this applet do not get loaded on a system using JRE1.4 however it works fine with systems having JRE 1.5. Isn't JDK 1.5 backward compatible. Can anyone please help. Below is the tag, I am using tp display applet in my JSP
<div align="center"> <applet codebase = "." archive = "WebPOSApplet.jar" code = "webposprint.DebitMainApplet.class" name = "Trans Applet" width = "450" height = "112" hspace = "0" vspace = "0" align = "middle" > <param name = "sourceInfo" value = "DebitTrans.do"> <param name = "redirectInfo" value = "SearchProducts.do"> </applet>
<%/* %> <OBJECT classid = "clsid:CAFEEFAC-0014-0002-0000-ABCDEFFEDCBA" codebase = "http://java.sun.com/products/plugin/autodl/jinstall-1_4_2-windows-i586.cab#Version=1,4,2,0" WIDTH = 450 HEIGHT = 112 > <PARAM NAME = CODE VALUE = webposprint.DebitMainApplet.class> <PARAM NAME = archive VALUE = WebPOSApplet.jar> <PARAM NAME = "type" VALUE = "application/x-java-applet;jpi-version=1.4.2"> <param name = "sourceInfo" value = "DebitTrans.do"> <param name = "redirectInfo" value = "SearchProducts.do"> <PARAM NAME = "scriptable" VALUE = "false"> <PARAM NAME = model VALUE=models/buckminsterfullerine.xyz> <COMMENT> <EMBED type = "application/x-java-applet;jpi-version=1.4.2" \ CODE = webposprint.DebitMainApplet.class\ archive = WebPOSApplet.jar\ WIDTH = 373 \ HEIGHT = 167 \ model =models/buckminsterfullerine.xyz \ scriptable = false \ pluginspage = "http://java.sun.com/products/plugin/index.html#download"> <NOEMBED> alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason." Your browser is completely ignoring the <APPLET> tag! </NOEMBED> </EMBED> </COMMENT> </OBJECT> <% */%> </div>
"Know where to find the solution and how to use it - that's the secret of success."
Joined: Mar 22, 2005
On your way in you may have missed that JavaRanch has a policy on display names, and yours does not comply with it - please adjust it accordingly, which you can do right here. Thanks for your prompt attention to this matter.
In regard to your question, class files created by 1.5 are not generally compatible with 1.4 JVMs. Check this page for details. There are ways of improving the backwards compatibility; check this page for certain compiler switches you can use, particularly -source and -target.
Joined: Nov 14, 2005
Thanks for update about name policy. Anyways if I use -source 1.5 and target 1.4, in that case will applet work with JRE1.5
author and iconoclast
Originally posted by Amir Rafique: in that case will applet work with JRE1.5
JDK 1.5 will run any older class file version; but older ones won't run newer versions. It's the same with, for example.Microsoft Word: Word 4 and 5 won't read Word 6 or Word 97 format, but Word 97 would read all those formats.
You can't use source="1.5" with an earlier target version. If you want to compile for 1.4, you have to use source="1.4" and not use any 1.5 language features.
Joined: Nov 17, 2005
Hey Amir, why don't you compile your applet with jdk 1.4, this way you will guarantee that it will work with both 1.4 and 1.5 in case you get errors in compilation, you will need to find workarounds (these maybe the same ones causing jre1.4 not to run your applet) Best, Mohammad