'How to run Applet with dependencies jar file in HTML

I have a jar file containing applet files which are dependent of below additional jar file. Its running fine as standalone jar file. The applet uses:

  1. xmlrpc-2.0.jar
  2. commons-codec-1.3.jar

But when I tried to run in HTML as below, it's running, but attached additional jar files are not binding with it. How can I fix the problem?

<html>
<body>
<APPLET 
  CODE="MAIN.class"
  WIDTH="100%" HEIGHT="100%"
  ARCHIVE = "MAIN.jar,xmlrpc-2.0.jar,commons-codec-1.3.jar"
  >
This example uses an applet.
</APPLET>
</body>
</html>

Manifest

Manifest-Version: 1.0
Main-Class: MAIN
Created-By: 1.3.0 (Sun Microsystems Inc.)
Class-Path: xmlrpc-2.0.jar commons-codec-1.3.jar
Name: MAIN.class


Solution 1:[1]

It should work as long as the jar files are in the same folder than your MAIN.jar. Can you see any classpath-related error in the Java console?

You can also try to use a manifest file as described here.

Solution 2:[2]

FatJar for Eclipse worked for me. Just be careful when you have multiple projects open, since it has a tendency to grab other stuff from non-related projects and roll that into your fatjar too.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Guido
Solution 2 adv