Error Compiling Scala Spark using SBT Console in IntelliJ IDEA - intellij-idea

I tried to compile Scala Spark project that I got using get-idea following this tutorial https://anitatailor.wordpress.com/2013/10/09/setting-up-spark0-8-0-with-intellijidea/
But when I tried to compile Scala Spark using SBT Console in IntelliJ IDEA, I got some errors.
You may see the error logs below
java -Dsbt.log.noformat=true -Djline.terminal=jline.UnsupportedTerminal -Xmx512M -XX:MaxPermSize=256M -jar C:\Users\Priska\.IdeaIC14\system\sbt\sbt-launch.jar
[info] Loading project definition from D:\spark-incubating\project\project
[info] Compiling 1 Scala source to D:\spark-incubating\project\project\target\scala-2.9.2\sbt-0.12\classes...
[error] error while loading CharSequence, class file 'D:\IDEA\jre\jre\lib\rt.jar(java/lang/CharSequence.class)' is broken
[error] (bad constant pool tag 15 at byte 1501)
[error] error while loading Comparator, class file 'D:\IDEA\jre\jre\lib\rt.jar(java/util/Comparator.class)' is broken
[error] (bad constant pool tag 15 at byte 5003)
[error] two errors found
[error] (compile:compile) Compilation failed
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
Can you help me to solve the problem?
Any help would be appreciated.
Thank you

Related

sbt.compiler.EvalException: Type Error in Expression

I'm quite new with IntelliJ (and on this site too tbh) and have been using it for only a couple of days. When I tried to build my project this exception came up. I tried to solve the problem but to no avail. I tried to see if the same problem occured on a newly created project and yes it does. So the code I've written should have no influence on the build. Iäve also checked if there might be a problem with the sbt version but I am up to date.
This is what the error looks like. I have absolutely no clue how to solve this so any help would be very much appreciated.
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[warn] Executing in batch mode.
[warn] For better performance, hit [ENTER] to switch to interactive mode, or
[warn] consider launching sbt without any commands, or explicitly passing 'shell'
[info] Loading global plugins from C:\Users\Johner-Institut\.sbt\0.13\plugins
Waiting for lock on C:\Users\Johner-Institut\.ivy2\.sbt.ivy.lock to be available...
[info] Loading project definition from C:\Users\Johner-Institut\Desktop\Project\project
C:\Users\Johner-Institut\Desktop\Project\build.sbt:5: error: recursive value project needs type
lazy val `project` = (project in file(".")).enablePlugins(PlayScala)
^
sbt.compiler.EvalException: Type error in expression
[error] sbt.compiler.EvalException: Type error in expression
[error] Use 'last' for the full log.
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
Don't use project as a name for sbt project, that's why the recursion error. Try something like:
lazy val root = (project in file(".")).enablePlugins(PlayScala)

Why does building Spark sources give "object sbt is not a member of package com.typesafe"?

I tried to compile the https://github.com/apache/spark project using IntelliJ IDEA with the sbt plugin on Windows.
I'm facing an error about sbt. Since I'm not familiar with sbt, I don't know how to fix it.
The error messages are as follows:
[info] Loading project definition from F:\codeReading\sbtt\spark-master\project
[info] Compiling 3 Scala sources to F:\codeReading\sbtt\spark-master\project\target\scala-2.10\sbt-0.13\classes...
[error] F:\codeReading\sbtt\spark-master\project\SparkBuild.scala:26: object sbt is not a member of package com.typesafe
[error] import com.typesafe.sbt.pom.{PomBuild, SbtPomKeys}
[error] ^
[error] F:\codeReading\sbtt\spark-master\project\SparkBuild.scala:51: not found: type PomBuild
[error] object SparkBuild extends PomBuild {
[error] ^
[error] F:\codeReading\sbtt\spark-master\project\SparkBuild.scala:118: not found: value SbtPomKeys
[error] otherResolvers <<= SbtPomKeys.mvnLocalRepository(dotM2 => Seq(Resolver.file("dotM2", dotM2))),
[error] ^
[error] F:\codeReading\sbtt\spark-master\project\SparkBuild.scala:178: value projectDefinitions is not a member of AnyRef
[error] super.projectDefinitions(baseDirectory).map { x =>
[error] ^
[error] four errors found
[error] (plugins/compile:compile) Compilation failed
Spark is built with Maven. The SBT build is only a convenience. You will have far better results importing it as a Maven project.
It looks like IDEA doesn't like project references to git projects that the Spark build definition uses for sbt-pom-reader.
It's showed up when I ran sbt within the cloned project:
➜ spark git:(master) ✗ xsbt
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[info] Loading project definition from /Users/jacek/oss/spark/project/project
[info] Loading project definition from /Users/jacek/.sbt/0.13/staging/ec3aa8f39111944cc5f2/sbt-pom-reader/project
[warn] Multiple resolvers having different access mechanism configured with same name 'sbt-plugin-releases'. To avoid conflict, Remove duplicate project resolvers (`resolvers`) or rename publishing resolver (`publishTo`).
[info] Loading project definition from /Users/jacek/oss/spark/project
[info] Set current project to spark-parent (in build file:/Users/jacek/oss/spark/)
>
You can see the project reference to the git project of sbt-pom-reader when accessing the plugins project for which the reference is defined:
> reload plugins
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[info] Loading project definition from /Users/jacek/oss/spark/project/project
[info] Updating {file:/Users/jacek/oss/spark/project/project/}project-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Loading project definition from /Users/jacek/.sbt/0.13/staging/ec3aa8f39111944cc5f2/sbt-pom-reader/project
[warn] Multiple resolvers having different access mechanism configured with same name 'sbt-plugin-releases'. To avoid conflict, Remove duplicate project resolvers (`resolvers`) or rename publishing resolver (`publishTo`).
[info] Updating {file:/Users/jacek/.sbt/0.13/staging/ec3aa8f39111944cc5f2/sbt-pom-reader/project/}sbt-pom-reader-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Loading project definition from /Users/jacek/oss/spark/project
> projects
[info] In file:/Users/jacek/oss/spark/project/
[info] * plugins
[info] spark-style
[info] In https://github.com/ScrapCodes/sbt-pom-reader.git
[info] sbt-pom-reader
A solution could be executing sbt gen-idea to generate the project files for IDEA. It's just a guess, though.

Binary incompatibility in plugins detected in Play 2.1.3 project after upgrading to IDEA 13.1?

After updating IntelliJ IDEA to 13.1 last night I can't use Run/Debug config anymore. It happens in a project I've been working on in IDEA 13.0.x for the past couple of months -- now it shows me the message and I have no idea how I can solve this.
[info] Loading project definition from /www/play20apps/cnproject/project
[error] sbt.IncompatiblePluginsException: Binary incompatibility in plugins detected.
[error] Note that conflicts were resolved for some dependencies:
[error] asm:asm
[error] asm:asm-tree
[error] asm:asm-util
[error] org.avaje.ebeanorm:avaje-ebeanorm-agent
[error] jline:jline
[error] junit:junit
[error] com.jcraft:jsch
[error] commons-logging:commons-logging
[error] commons-codec:commons-codec
[error] Use 'last' for the full log.
[error] java.lang.ExceptionInInitializerError
[error] Use 'last' for the full log.
[error] Not a valid command: run
[error] run
[error] ^
Process finished with exit code 1
I didn't change Play version since yesterday of course and running application with common command line works as expected.
Also tried to create new run config after plugins' update with no luck.
Please advise.
Adding -Djline.terminal= to JVM Options should fix it.
last log reports this.
The relevant part:
Caused by: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: none
at jline.Terminal.setupTerminal(Terminal.java:65)
at jline.Terminal.getTerminal(Terminal.java:26)
at sbt.JLine$.sbt$JLine$$terminal(LineReader.scala:65)
where none is probably passed via -Djline.terminal=none.

Scala: SBT Eclipse plugin fails to build Breeze from scalanlp.org

I am new to Breeze (http://www.scalanlp.org/) and Scala in general. Please help to generate
Eclipse project for Breeze with sbt. I have Eclipse plugin for sbt installed.
When I try sbt eclipse it fails with the following errors. What is
wrong?
Thanks!
> ~/Distrib/Scala/breeze-master>sbt
[info] Loading global plugins from /home/an/.sbt/plugins
[info] Loading project definition from /home/an/Distrib/Scala/breeze-
master/project
[info] Set current project to breeze (in build file:/home/an/Distrib/
Scala/breeze-master/)
> eclipse
[info] About to create Eclipse project files for your project(s).
[error] java.util.NoSuchElementException: None.get
[error] Use 'last' for the full log.
> last
...
...
[debug] Project dependencies for configuration 'compile':
Success(List(breeze-math))
[debug] Project dependencies for configuration 'test': Success(List())
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:274)
at scala.None$.get(Option.scala:272)
at com.typesafe.sbteclipse.core.Eclipse$.relativize(Eclipse.scala:
498)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$srcEntry
$1.apply(Eclipse.scala:252)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$srcEntry
$1.apply(Eclipse.scala:249)
at scalaz.effects.IO$$anon$3$$anonfun$pure$1$$anonfun$apply
$23.apply(IO.scala:118)
at scalaz.effects.IO$$anon$3$$anonfun$pure$1$$anonfun$apply
$23.apply(IO.scala:118)
at scalaz.FreeFunctions$$anonfun$return_$1.apply(Free.scala:181)
at scalaz.FreeFunctions$$anonfun$return_$1.apply(Free.scala:181)
at scalaz.Pure$$anon$19$$anon$2.apply(Pure.scala:76)
at scalaz.Functor$$anon$15$$anon$45.apply(Functor.scala:84)
at scalaz.Free$class.go$1(Free.scala:73)
at scalaz.Free$class.run(Free.scala:76)
at scalaz.Free$Gosub.run(Free.scala:18)
at scalaz.effects.IO$class.unsafePerformIO(IO.scala:13)
at scalaz.effects.IO$$anon$2.unsafePerformIO(IO.scala:113)
at com.typesafe.sbteclipse.core.Eclipse$.onSuccess(Eclipse.scala:149)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$action
$4.apply(Eclipse.scala:105)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$action
$4.apply(Eclipse.scala:105)
at scalaz.Validation$class.fold(Validation.scala:7)
at scalaz.Success.fold(Validation.scala:82)
at com.typesafe.sbteclipse.core.Eclipse$.action(Eclipse.scala:105)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$eclipseCommand
$2.apply(Eclipse.scala:81)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$eclipseCommand
$2.apply(Eclipse.scala:81)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply
$2.apply(Command.scala:60)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply
$2.apply(Command.scala:60)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply
$3.apply(Command.scala:62)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply
$3.apply(Command.scala:62)
at sbt.Command$.process(Command.scala:90)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(MainLoop.scala:
71)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(MainLoop.scala:
71)
at sbt.State$$anon$2.process(State.scala:170)
at sbt.MainLoop$$anonfun$next$1.apply(MainLoop.scala:71)
at sbt.MainLoop$$anonfun$next$1.apply(MainLoop.scala:71)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.MainLoop$.next(MainLoop.scala:71)
at sbt.MainLoop$.run(MainLoop.scala:64)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:53)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:50)
at sbt.Using.apply(Using.scala:25)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:50)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:33)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:17)
at sbt.MainLoop$.runLogged(MainLoop.scala:13)
at sbt.xMain.run(Main.scala:26)
at xsbt.boot.Launch$.run(Launch.scala:55)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:45)
at xsbt.boot.Launch$.launch(Launch.scala:69)
at xsbt.boot.Launch$.apply(Launch.scala:16)
at xsbt.boot.Boot$.runImpl(Boot.scala:31)
at xsbt.boot.Boot$.main(Boot.scala:20)
at xsbt.boot.Boot.main(Boot.scala)
[error] java.util.NoSuchElementException: None.get
[error] Use 'last' for the full log.
>
This is a known bug in sbteclipse: https://github.com/typesafehub/sbteclipse/issues/128
You can try commenting out the "doc" project in the Project.scala definition and see if that helps. Otherwise, I think this is a bug in sbteclipse that has to get resolved first.

Tiatnium base 64 module for image encoding decoding

Hi I was trying to encode the base64 string from blob/image file.I was shocked when i came to know that "Ti.Utils.base64encode()" method only works in android but wont give the same string in IOS.So after searching through blogs for getting the solution ,i found http://www.clearlyinnovative.com/blog/post/9546524557/titanium-appcelerator-quickie-base64encode-ios-module#.UUqY2VuPg4U
When i try to run the project by including this module in project its getting error log while building the project for ios.Could any on help.Thanks in advace.
[ERROR] : ** BUILD FAILED **
[ERROR] : The following build commands failed:
[ERROR] : Ld build/Debug-iphonesimulator/postfile.app/postfile normal i386
[ERROR] : (1 failure)