ClassDefNotFoundException after adding jar to simple java project

140 Views Asked by At

I am adding commons.math jar to my project in NetBeans but during creating instance of simple Class, project throws ClassDefNotFoundException. Any suggestions guys? Math jar located on desktop, but even moving it to .m2 repo did not affect the result.

Thanks.

UPD. Problem was found - looks like classpath string error was formatted incorrectly.

1

There are 1 best solutions below

0
On

It sounds like a straightforward issue with classpath resolution.

Check your runtime classpath on NetBeans. Are you running from NetBeans or from command line. Check runtime classpath regardless.

If you are in NetBeans try to browse the jar to make sure class is indeed in it.

Also make sure there are no two jars with the same class name.