One-Jar for Applet

179 views Asked by At

I have an applet that needs to import another libraries. I used Apache Ant to build this applet and libraries into same jar files, but there is no way to connect classes with libraries. I got NoClassDefFoundError.

Because of that I decided to use one-jar with Ant. One-jar creates a jar files that contains libraries and classes. But classes that I wrote are in another jar inside of main jar. Directory looks like below :

  • main.jar
    • com
    • doc
    • lib
    • main
      • applets.jar
        • MyApplet.class

I need to access MyApplet class in applets.jar file but problem is that how can I import my applet class which is in second jar. It's not possible to write second attribute in applet tag.

Is there any option in one-jar to build only one jar with libraries? What should I use?

1

There are 1 answers

12
Andrew Thompson On

It's not possible to write second attribute in applet tag.

Then it is a good thing there is no need to. The archive attribute of the applet element can list multiple Jars, which is how you should approach this.