简体   繁体   中英

Import class file from specific jar

I am working with 2 jars , base.jar and derived.jar where I ordered it the class path in this way: base.jar and then derived.jar

I have a problem that I have a class with the same name package in both jars it's third party that I can't change

And in code I want to import the class from the derived.jar with out change the class path order ?

Is there an option to it in my code in the import command or by adding annotation?

thanks

If you write your own classloader with a predictable jar loading order - yes. But you should instead rename the class/package.

如果它是第三方并且你有源,你可以自己重构该类并重建jar。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM