Reputation: 61
Hi I am trying to embed a java applet in a HTML 5 page. But I keep getting a class not found error.
I have 3 files all part of package applet in larger project. I compile the *.java files, then package up with the following command.
jar cfm0 DataUpload.jar manifest *.class
manifest file
Manifest-Version: 1.0
Permissions: all-permissions
Codebase: *
Application-Name: DataUpload
Sign and place the jar in root dir of the HTML page and call the applet with the following code.
<object type="application/x-java-applet" name="DataUpload" width="500" height="300">
<param name="name" value="DataUpload" />
<param name="archive" value="DataUpload.jar" />
<param name="code" value="DataUpload.applet.DataUpload" />
<param name="scriptable" value="true" />
<param name="codebase_lookup" value="false" />
<param name="mayscript" value="true" />
<param name="plugindetect" value="1" />
</object>
Now I think its a problem with code because I was getting wrong name without the applet.DataUpload section. So I added the DataUpload As the base jar address.However no progress
Any help would be very useful
Upvotes: 1
Views: 793
Reputation: 201527
Change <param name="code" value="DataUpload.applet.DataUpload" />
to <param name="code" value="DataUpload" />
and make sure your applet isn't actually in a package. If your code is in a package, then your jar command needs to reflect that (you would need to preserve the folder hierarchy to preserve the package name).
Upvotes: 1