简体   繁体   中英

Insert JAR into html without Class file

I am trying to put a java program into a HTML page and when launch the page nothing shows up.
How do I call this applet, the only thing I have is a JAR file, I didn't write the program. Thanks all!

edit1: Also I kinda got something going but now it says missing code parameter.

You'll need either a CODE attribute or an OBJECT attribute.

From the Oracle guide to embedding APPLETs:

CODE=< appletFile>

This REQUIRED attribute gives the name of the file that contains the applet's compiled Applet subclass. This file is relative to the base URL of the applet. It cannot be absolute. One of CODE or OBJECT must be present. The value appletFile can be of the form classname.class or of the form packagename.classname.class.

OBJECT=< serializedApplet >

This attribute gives the name of the file that contains a serialized representation of an Applet. The Applet will be deserialized. The init() method will not be invoked; but its start() method will. Attributes valid when the original object was serialized are not restored. Any attributes passed to this APPLET instance will be available to the Applet; we advocate very strong restraint in using this feature. An applet should be stopped before it is serialized. One of CODE or OBJECT must be present.

More, and a tutorial here: http://download.oracle.com/javase/1.4.2/docs/guide/misc/applet.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM