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
- applets.jar
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?
Then it is a good thing there is no need to. The
archive
attribute of theapplet
element can list multiple Jars, which is how you should approach this.