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
Apache Commons Lang 2 vs 3
提问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.lang
to com.apache.commons.lang3
so that you can have both version in classpath without conflict
您可以在类路径中同时使用 Lang2 和 Lang3。由于 Lang2 和 Lang3 不兼容,特意将包从com.apache.commons.lang
改为com.apache.commons.lang3
以便您可以在类路径中同时拥有两个版本而不会发生冲突