Image

Hi,

Maybe you know where is the source of the problem.

I have created a java project.

Into the project there is a class, that uses classes from Lib.jar library.

To run the application I used the following command:

java -cp .;c:\MyFolder\Lib.jar com.mypackage.TheMainApplication

When I ran this project using a bunch of compiled *.class files (as is shown above) all worked fine.

But.

When I create jar file from these *.class files, (let's say: myapp.jar) and run it using command:

java -cp .;c:\MyFolder\Lib.jar -jar myapp.jar

all worked fine, until my code runs that class, that refers to Lib.jar file.

I get the following exception:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/package/SomeExternalClass

I completely do not understand. Why, when I ran this code as class files I do not get this exception, but when I create jar file I get this error.

Please help.

Thank you.