Reputation: 694
I have an applet like this
package myPackage;
public class MyApplet extends JApplet
{
....
My html have this code
<object id="MyApplet" height="100" width="100" name="MyApplet" type="application/x-java-applet;version=1.4.1">
<param name="archive" value="MyApplet.jar"" />
<param name="code" value="myPackage.MyApplet" />
<param name="mayscript" value="yes" />
<param name="scriptable" value="true" />
<param name="name" value="MyApplet" />
</object>
When trying applet functionality on localhost - everything is OK.
But from another computer I have an error
load: class myPackage.MyApplet not found.
java.lang.ClassNotFoundException: myPackage.MyApplet
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassNotFoundException: myPackage.MyApplet
Upvotes: 0
Views: 252
Reputation: 10780
From Java/Oracle documentation:
When deploying applets:
- Use the applet tag if the Web page is accessed through the Internet.
- Use the object or embed tag if the Web page is accessed through an Intranet.
And:
Note: The HTML specification states that the applet tag is deprecated, and that you should use the object tag instead. However, the specification is vague about how browsers should implement the object tag to support Java applets, and browser support is currently inconsistent. Sun therefore recommends that you continue to use the applet tag as a consistent way to deploy Java applets across browsers on all platforms.
Upvotes: 2