How to load jar files such that an applet can use its class library?

L

Lekyan

Hello,

I got a problem dealing with jar files and applet. Any help will be
greatly appreciated!

This is my situation:
I have my applet, let's call it myclass.class. It makes use of the
jpcap library. I put it at
C:\j2sdk1.4.2_01\jre\lib\ext\net.sourceforge.jpcap-0.01.13.jar

When I test my applet using the Eclipse IDE, it is fine. But when I
wrote a simple html page, the debug console will say
"NoClassDefFoundError:
net/sourceforge/jpcap/capture/PacketCapturet"... well, it would be
magic if it can find it. But how do I deploy the applet along with
the jar file such that people can use my applet on the webpage?

The index.html file is simple and has the following content:

<APPLET CODE=myclass.class WIDTH=800 HEIGHT=500></APPLET>

Thank you very much!
 
K

KC Wong

This is my situation:
I have my applet, let's call it myclass.class. It makes use of the
jpcap library. I put it at
C:\j2sdk1.4.2_01\jre\lib\ext\net.sourceforge.jpcap-0.01.13.jar

When I test my applet using the Eclipse IDE, it is fine. But when I
wrote a simple html page, the debug console will say
"NoClassDefFoundError:
net/sourceforge/jpcap/capture/PacketCapturet"... well, it would be
magic if it can find it. But how do I deploy the applet along with
the jar file such that people can use my applet on the webpage?

The index.html file is simple and has the following content:

<APPLET CODE=myclass.class WIDTH=800 HEIGHT=500></APPLET>

Use the "archive" attribute:
http://www.w3.org/TR/html401/struct/objects.html#edef-APPLET
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top