Accessing helper classes for an Applet through a jar
Posted on 2007-04-06
I have an applet that is included in a jar file. The applet class has an import for a class within package access. The applet works in Eclipse but when I deploy it and use it with a browser, it loads the applet class and when it tries to access a helper class within the package the error console says it cannot initialize that helper class. But if its in the jar file and it can find the applet class, why can't it find other classes in the jar? For instance, I have package.myApplet and package.myHelperClass. Both classes are in the jar file. In my applet loader, I have the archive set to the jar, and the code set to package.myApplet. It loads, but says it cannot initialize package.myHelperClass in the Java Console.
<applet archive="myJar.jar" code="package.myApplet" height="200" width="200"></applet>
Contents of myJar.jar:
Another note is that I am trying to access the helper class statically, ie myHelperClass.someStaticMethod(). I don't create an instance.