为什么Scala无法找到org.apache.commons.lang包? [英] Why can't Scala find org.apache.commons.lang package?

查看:120
本文介绍了为什么Scala无法找到org.apache.commons.lang包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 org.apache.commons.lang.NotImplementedException ,因为它似乎是Java/Scala域中唯一的NotImplementedException实现.我记得我曾经在Scala 2.8.1中使用它而没有任何技巧.但是现在它说"object lang不是包org.apache.commons的成员". org.apache.commons.lang哪里去了?

I want to use org.apache.commons.lang.NotImplementedException as it seems to be the only NotImplementedException implementation in Java/Scala domain. I can remember I used to use it with Scala 2.8.1 with no hacks. But now it says "object lang is not a member of package org.apache.commons". Where has org.apache.commons.lang gone?

推荐答案

我刚刚找到了答案.问题是Apache Commons 3不再包含lang(而是包括lang3,这是一个区别,并且不包含NotImplementedException),因此我们需要Apache Commons 2.6.而且这里不明显的是它的Maven组ID不是org.apache.commons,而是commons-lang-与它的工件ID相同.

I've just found the answer myself. The problem is Apache Commons 3 no longer include lang (including lang3 instead, which is differend and doesn't contain NotImplementedException), so we need Apache Commons 2.6. And what's inobvious here is that the Maven group id for it is not org.apache.commons, but commons-lang - the same as its artifact id.

所以我必须添加"commons-lang" % "commons-lang" % "2.6"依赖项并进行sbt更新以使其起作用.

So I had to add "commons-lang" % "commons-lang" % "2.6" dependency and do sbt update to make it work.

这篇关于为什么Scala无法找到org.apache.commons.lang包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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