What about Java dependency conflicts?

I wrote a plug-in B for software A. Plug-in B relies on Cpene C and class D. the only thing I can modify is B. now the problem is that there is already a class D in software A, but its D is not the same as the D version that C depends on in my plug-in, and the interface is not the same. Please tell me what method can be used to operate normally, neither A nor C can be modified.

Mar.04,2021

Class conflicts only occur when the fully qualified name (classpath + class name) is the same, and there is no significant difference between different versions. After all, the function and orientation of this class are fixed. It is recommended that when writing B, we should rely on the D version used by A. When coding, we should call


ClassLoader according to the API of this version. Do you know? Try customizing ClassLoader loading?

Menu