java.lang.NoClassDefFoundError with two BouncyCastle jars

Viewed 15560

I have included 2 BC jars into my project: bcpkix-jdk15on-1.47.jar and bcprov-jdk15on-157.jar.

As the first line in code I have added:

Security.addProvider(new BouncyCastleProvider());  

Exception occurs on the line:

JcaPKCS10CertificationRequest csrNew = new JcaPKCS10CertificationRequest(request);

By the way it is imported: import org.bouncycastle.pkcs.jcajce.JcaPKCS10CertificationRequest; 

But I am still getting :

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/bouncycastle/jcajce/JcaJceHelper at implementation.Util.generateCSR(Util.java:396)

NetBeans found class regularly, but when I run project exception happens.

Is there any way how could I regularly include both of these two BouncyCastle jars?

1 Answers
Related