Reputation: 33
I'm trying to use import guava library in SBT project (play framework), but can't compile my code
import com.google.common.net.InternetDomainName
class MyClass(link: String) {
private val domains = {
val host = new URL(link).getHost
val domainName = InternetDomainName.from(host)
domainName.topPrivateDomain().name()
}
}
I get compilation error
object google is not a member of package com
Can anyone explain, what is the problem?
Upvotes: 3
Views: 7193
Reputation: 11668
Have you added the guava library as a library dependency to your build.sbt
file? You can find that file in the project's root directory. There you can add the dependency to the guava library:
libraryDependencies ++= Seq(
"com.google.guava" % "guava" % "17.0",
// other dependencies separated by commas
)
Upvotes: 13