我创建了一个带有编译Java类的jar文件。现在我想在Scala中导入它。但它不起作用。
包名称为se.mydomain.testproj
,这是一个小型Scala应用程序:
object TestCrypt {
import se.mydomain.testproj._
def main(args: Array[String]) {
println("Hello")
}
}
我使用Eclipse并将jar文件添加到Build Path。
在Eclipse中,我收到错误:not found: value se
如何从Scala中的Jar文件导入Java类?
答案 0 :(得分:2)
我一直在Eclipse中这样做,所以它绝对有效。您是否在项目的Referenced Libraries中看到了jar?你有包裹名称吗?
此外,对象中的导入应该没有问题。