apache spark - How to write the "import scala.io.Source" , "import java.io" libraries in SBT -
i compiling scala program using sbt gives me following error "import scala.io.source" , "import java.io"
sbt.resolveexception: unresolved dependency: org.scala#scala.io.source_2.11;latest.integration: not found [error] unresolved dependency: org.java#java.io_2.11;latest.integration: not found
my sbt format given below:
name := "simple project" version := "1.0" scalaversion := "2.11.7" librarydependencies ++= seq( "org.apache.spark" %% "spark-graphx" % "2.0.1", "org.scala" %% "scala.io.source" % "latest.integration", "org.java" %% "java.io" % "latest.integration" )
anybody can how can specify "import scala.io.source" , "import java.io" in sbt.
one needs make distinction between library dependencies , package imports: library dependencies managed through build system (like sbt or maven or grails,...) , make complete libraries (like logging api, http implementation, ...) available system being built.
at program level, imports
used bring specific parts of libraries scope of code being developed.
given build.sbt
name := "examplebuild" version := "0.0.1" scalaversion := "2.11.7" librarydependencies ++= seq( "com.typesafe" % "config" % "1.2.1", "org.scalaj" % "scalaj-http_2.11" % "2.3.0" )
we can develop scala program can use configuration library typesafe , http library scalaj
sample.scala
package com.example import scala.io.source // scala standard library import java.io._ // import io package standard java library import com.typesafe.configfactory // typesafe config library import scalaj.http._ // import members of scalaj.http package class sample { // code here }
Comments
Post a Comment