How to Solve Error Message package org.bouncycastle.util does not exist

Posted on

Introduction

This is an error where the occurrence of the error itself appear on the execution of the Java-based program. Actually, the occurrence of the error is generating message of a certain package does not exist. The process for compiling the Java-based program in Netbeans Java IDE ends in a failure. Also, the build and compile process is using maven tool. It generate the error as the following complete output :

-------------------------
COMPILATION ERROR : 
-------------------------------------------------------------
com/apps/models/Test.java:[3,29] package org.bouncycastle.util does not exist
1 error
-------------------------------------------------------------
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time:  05:06 min
Finished at: 2021-07-05T10:58:07+07:00
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project appdev: Compilation failure
com/apps/models/Test.java:[3,29] package org.bouncycastle.util does not exist

Solution

The solution for solving the problem is very easy. Just edit the ‘pom.xml’ file by adding the specific package name which is not available during the build and compile process. Just search the package name in the Maven Repository exist in this link. Another way to look for it, just search in the google search engine with the keyword of ‘maven repository’. After finding the Maven Repository page, just type ‘org.bouncycastle.util’ to find the definition of the dependency for the package. The following is the result of the dependency package with the name of ‘org.bouncycastle.util’ :

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15to18</artifactId>
<version>1.69</version>
</dependency>

Care to see the artifactId of the package. If the program run in jdk 15 only or another version of the jdk, just choose that package with the suitable artifact. After editing the pom.xml file with the package dependency definition, just execute the compile and the build process once more. If there is no error further, the build and the compile process will end in a success.

Leave a Reply