user3680477
user3680477

Reputation: 81

Why am I not able to load the required libraries before running the JAR?

I have created a graph project which needs JFree chart library.When I run the program it runs normally.But when I convert it into a JAR from Eclipse and run, it throws an exception saying there NoClassDefFoundErrors.Actually these classes are in the library.Does it mean that the JAR program doesn't have the library appended?Please help.

Upvotes: 1

Views: 41

Answers (1)

AnOldSoul
AnOldSoul

Reputation: 4207

Export it as an runnable jar. Also put the referenced libraries inside the src folder.Additionally if there are any unwanted jars which are not referenced remove them.When converting into runnable jar mark 2nd option in Library Handling.

Upvotes: 1

Related Questions