1

I have been trying to find a way to BouncyCastleProvider in Java 11 from openjdk. Since there is no ext folder, I can't figure out where to put the jar file. I am using gradle build on MacOS Catalina. It will really help if someone can help me out on this.

I am getting the following error while running gradle build. I have dependency mentioned in gradle as well.

java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
Dark Lord
  • 415
  • 5
  • 16

1 Answers1

0

You can use the way you import all your other gradle dependencies.

For example with the dependency: compile group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.64'

Taken from: https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on/1.64 (Where you can find other versions if you need them)

If you're unsure how to import gradle dependencies I'd suggest searching Stackoverflow, as I'm sure that been asked many times before. For example: How to import external dependencies in gradle?

EDIT: You added another error. Could be the path of the jar needs to be added / classpath.

If you want to add the JAR to your ide, which I guess is Gradle Build Tool if I understood you right. They speak of how to do it here: How to add local .jar file dependency to build.gradle file?

GamingFelix
  • 239
  • 2
  • 10
  • Updated the questions, my gradle file is fine, look at this question : https://stackoverflow.com/questions/42630190/error-including-bouncycastle-provider – Dark Lord Feb 10 '20 at 15:03
  • Can you add the whole stack trace? You copied a link where someone suggested adding the classpath, so I assume you tried that? – GamingFelix Feb 10 '20 at 15:12