user994165
user994165

Reputation: 9512

JVM Loading duplicate libraries

If my Java application uses two JARS that each have the same version of a library, does the JVM only load the library once?

Upvotes: 1

Views: 1916

Answers (1)

Nicolas Barrera
Nicolas Barrera

Reputation: 527

If you have two identical jar files with different name, then JVM will load classes from the first jar it finds, but in this case you will find no problems.

If you have two jars with different name, but they contain different versions of the same classes then you have a problem because you won't know which version of that classes will the JVM load first.

Upvotes: 2

Related Questions