scala - Using SBT for and libraries for the first time: lots of errors -
i'm working on first larger project, newbie developer.
i found needed external library (junrar), downloaded sbt , made simple build.sbt. when try run program (with intellij) huge block of error messages.
information:8/23/16, 8:13 pm - compilation completed 1 error , 8 warnings in 10s 420ms error:scalac: error: org.jetbrains.jps.incremental.scala.remote.serverexception error compiling sbt component 'compiler-interface-2.9.1.final-52.0' @ sbt.compiler.analyzingcompiler$$anonfun$compilesources$1$$anonfun$apply$2.apply(analyzingcompiler.scala:145) @ sbt.compiler.analyzingcompiler$$anonfun$compilesources$1$$anonfun$apply$2.apply(analyzingcompiler.scala:142) @ sbt.io$.withtemporarydirectory(io.scala:291) @ sbt.compiler.analyzingcompiler$$anonfun$compilesources$1.apply(analyzingcompiler.scala:142) @ sbt.compiler.analyzingcompiler$$anonfun$compilesources$1.apply(analyzingcompiler.scala:139) @ sbt.io$.withtemporarydirectory(io.scala:291) @ sbt.compiler.analyzingcompiler$.compilesources(analyzingcompiler.scala:139) @ sbt.compiler.ic$.compileinterfacejar(incrementalcompiler.scala:52) @ org.jetbrains.jps.incremental.scala.local.compilerfactoryimpl$.org$jetbrains$jps$incremental$scala$local$compilerfactoryimpl$$getorcompileinterfacejar(compilerfactoryimpl.scala:87) @ org.jetbrains.jps.incremental.scala.local.compilerfactoryimpl$$anonfun$getscalac$1.apply(compilerfactoryimpl.scala:44) @ org.jetbrains.jps.incremental.scala.local.compilerfactoryimpl$$anonfun$getscalac$1.apply(compilerfactoryimpl.scala:43) @ scala.option.map(option.scala:146) @ org.jetbrains.jps.incremental.scala.local.compilerfactoryimpl.getscalac(compilerfactoryimpl.scala:43) @ org.jetbrains.jps.incremental.scala.local.compilerfactoryimpl.createcompiler(compilerfactoryimpl.scala:22) @ org.jetbrains.jps.incremental.scala.local.cachingfactory$$anonfun$createcompiler$1.apply(cachingfactory.scala:24) @ org.jetbrains.jps.incremental.scala.local.cachingfactory$$anonfun$createcompiler$1.apply(cachingfactory.scala:24) @ org.jetbrains.jps.incremental.scala.local.cache$$anonfun$getorupdate$2.apply(cache.scala:20) @ scala.option.getorelse(option.scala:121) @ org.jetbrains.jps.incremental.scala.local.cache.getorupdate(cache.scala:19) @ org.jetbrains.jps.incremental.scala.local.cachingfactory.createcompiler(cachingfactory.scala:23) @ org.jetbrains.jps.incremental.scala.local.localserver.compile(localserver.scala:22) @ org.jetbrains.jps.incremental.scala.remote.main$.make(main.scala:67) @ org.jetbrains.jps.incremental.scala.remote.main$.nailmain(main.scala:24) @ org.jetbrains.jps.incremental.scala.remote.main.nailmain(main.scala) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:497) @ com.martiansoftware.nailgun.ngsession.run(ngsession.java:319) warning:scalac: error: error while loading charsequence, class file '/library/java/javavirtualmachines/jdk1.8.0_73.jdk/contents/home/jre/lib/rt.jar(java/lang/charsequence.class)' broken (bad constant pool tag 18 @ byte 10) warning:scalac: error: error while loading annotatedelement, class file '/library/java/javavirtualmachines/jdk1.8.0_73.jdk/contents/home/jre/lib/rt.jar(java/lang/reflect/annotatedelement.class)' broken (bad constant pool tag 18 @ byte 76) warning:scalac: error: error while loading arrays, class file '/library/java/javavirtualmachines/jdk1.8.0_73.jdk/contents/home/jre/lib/rt.jar(java/util/arrays.class)' broken (bad constant pool tag 18 @ byte 765) warning:scalac: error: error while loading comparator, class file '/library/java/javavirtualmachines/jdk1.8.0_73.jdk/contents/home/jre/lib/rt.jar(java/util/comparator.class)' broken (bad constant pool tag 18 @ byte 20) warning:scalac: /var/folders/ly/9qm0nrln35ddtk1xyzmpw8n00000gn/t/sbt_d176391c/extractapi.scala:479: error: java.util.comparator not take type parameters warning:scalac: private[this] val sortclasses = new comparator[symbol] { warning:scalac: ^ warning:scalac: 5 errors found
build.sbt:
name := "cviewermain" version := "0.0.1" scalaversion := "2.9.1" librarydependencies += "com.github.junrar" % "junrar" % "0.7" // debugging sbt problems //loglevel := level.debug scalacoptions += "-deprecation"
there couple of things need in place.
on intellij side, need have module being built sbt
. open 'project structure' , click on 'modules'. in middle column should of modules being built. click on sbt
module and, in right side, select sbt
tab. if works, you're go. should this:
on sbt configuration side, need make sure the intellij plugin enabled. inside build/plugins.sbt
file. there line this:
addsbtplugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0") // intellij
that should need. if intellij showing different, try re-creating project , specifying sbt project. when point root level build.sbt
file.
to confirm sbt file valid, go command line @ root of project , execute sbt
. if loads, intellij should able take there. go intellij, open console , run same thing. (again, should work.) once sbt loads, execute task run app. if there error here should more verbose, allowing correct it.
Comments
Post a Comment