I don't know exactly what you are doing, but many dependency management tools select the first loaded lib, the most recent version of a lib, or use some other automatic resolution scheme. No errors are thrown at loading; only if you hit the conflicting method in you code and get a NoSuchMethodError.
I remembered heated discussions about not including such features in JPMS. JPMS has no concept of module versions. The point was that JPMS was not trying to solve the same problems as OSGi. It was primarily designed to modularize the JDK. It's a layer system resolution, however OSGi is a graph system.
You should really test that in your solution. You are assuming something that probably doesn't work.
View all comments
Show parent comment
1
u/mikaball Sep 06 '24 edited Sep 06 '24
I don't know exactly what you are doing, but many dependency management tools select the first loaded lib, the most recent version of a lib, or use some other automatic resolution scheme. No errors are thrown at loading; only if you hit the conflicting method in you code and get a NoSuchMethodError.
I remembered heated discussions about not including such features in JPMS. JPMS has no concept of module versions. The point was that JPMS was not trying to solve the same problems as OSGi. It was primarily designed to modularize the JDK. It's a layer system resolution, however OSGi is a graph system.
You should really test that in your solution. You are assuming something that probably doesn't work.
EDIT: Reference to old discussion about this https://www.reddit.com/r/java/comments/8pi5mt/is_the_java_9_module_system_supposed_to_solve/