Java Apache Commons Lang 2 与 3

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24158889/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 10:33:04  来源:igfitidea点击:

Apache Commons Lang 2 vs 3

javaapachejarapache-commons

提问by Tobia

In my application I'm using apache commons Lang v.3. A requried library give my a

在我的应用程序中,我使用 apache commons Lang v.3。一个必需的图书馆给我一个

java.lang.ClassNotFoundException: org.apache.commons.lang.StringUtils

Is there a build translation between commmon.lang to commons.lang3 or I have to add both lang libraries?

commmon.lang 到 commons.lang3 之间是否有构建转换,或者我必须添加两个 lang 库?

采纳答案by Adrian Shum

You can have both Lang2 and Lang3 in your classpath. Due to incompatibility of Lang2 and Lang3, the package is intentionally changed from com.apache.commons.langto com.apache.commons.lang3so that you can have both version in classpath without conflict

您可以在类路径中同时使用 Lang2 和 Lang3。由于 Lang2 和 Lang3 不兼容,特意将包从com.apache.commons.lang改为com.apache.commons.lang3以便您可以在类路径中同时拥有两个版本而不会发生冲突