IllegalAccessError, when running from JAR

J

Java and Swing

I have an application which loads some Java code from a JAR. So I have
two jar files....

MyApp.jar and Blah.jar.

MyApp.jar is the main application, and at some point it uses a
ClassLoader to load Blah.jar, and instantiate a class inside of it.
However, for some reason when I run MyApp from the jar, as such:

java -jar MyApp.jar .....I get IllegalAccessError: tried to load class
from ......etc.

However, if I run it from the class files as such:

java -cp bin;Blah.jar com.acme.foo.Main it works just fine.

Any ideas what the problem is? how to fix it?

thanks
 

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,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top