JVM如何处理不同版本的重复JAR [英] How does JVM deal with duplicate JARs of different versions

查看:123
本文介绍了JVM如何处理不同版本的重复JAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当存在具有不同版本的重复JAR时,行为非常不一致。有谁知道JVM如何处理重复项?

When there were duplicate JARs with different versions, the behavior was very inconsistent. Does anyone know how the JVM deals with duplicates?

推荐答案

类加载器按顺序搜索类路径,并使用第一个匹配的类发现。

The classloader searches the classpath in order, and uses the first matching class it finds.

这篇关于JVM如何处理不同版本的重复JAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆