Java application not finding bouncycastle provider

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Java application not finding bouncycastle provider

johny
This post has NOT been accepted by the mailing list yet.
I am using bouncycastle provider in a java application build using gradle.

apply plugin: 'java'
sourceCompatibility = '1.6'
version = '1.0.0'


dependencies {
    compile "org.mariadb.jdbc:mariadb-java-client:+",
    compile "org.bouncycastle:bcprov-jdk15on:+",
    compile "commons-codec:commons-codec:+",
    testCompile libraries.junit
}

The application builds successfully. But when I try to run the application I get the following error.

Exception in thread "main" java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
        at com.example.application.main(Server.java:50)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 6 more

How can I fix it ?


Loading...