Get the App
SLTechnology News&Howtos  ›  Development  › 

What if the same package name and class name conflict is introduced under two jar packages

Shulou Source: shulou.com Published: 2022-06-01 09:54:39 10月04日 Update

This article will explain in detail how to introduce conflicts with the same package names under two jar packages. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Sometimes the package name class name in the introduced jar package is the same as that in other jar packages, so that the program cannot correctly reference the desired class when compiling or running. the solution is to remove the jar package that is not needed.

There is a project that requires OpenCV and javacv, but javacv already contains another version of openCV, which is not consistent with the OpenCV version we need, but the compile and run time program introduces a version that we don't need.

one。 Look at the maven tree and take idea as an example

Locate the OpenCV entry in javacv and double-click

Find the coordinates of OpenCV in javacv

two。 Modify the pom file

This is the end of the article on "how to introduce conflicts with the same package names under two jar packages". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Class name same version article two how to do conflict time more program compile run good practical consistent content coordinates that is file article Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Redmi NVidia Microsoft MySQL