Import Java library to Scala sbt project -


I'm trying to use the Import Ivava library in the SBT project (play framework), but my code can not be compiled

< P> P>
  import com.google.common.net.InternetDomainName class MyClass (link: string) {personal val domain = {val host = new URL (link) .getHost val domain name = InternetDomainName. From (host) DomainName.topPrivateDomain (). Name ()}}  

I get a compilation error

  Object is not a member of google package com  

Can anyone explain, what is the problem?

Did you add the Java library to your build.sbt file's library As a dependency? You can find that file in the project's root directory. There you can add dependency to the pab library:

  libraryDependencies ++ = Seq ("com.google.guava"% "guava"% "17.0", // other dependencies separated by commas)  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -