0

I have ubuntu 14, and have installed latest sbt and then installed Eclipse for scala. I then created a scala project, and then a worksheet.

I typed in a few line like 1+2 etc, but the sheet doesn't evaluate.

Below is my system configuration:

  • OS: Ubuntu 14
  • sbt version: 0.13.13
  • JAVA version: 8
  • eclipse version: Version: 4.5.0 (neon.1)

I have NOT installed Scala.

Can someone suggest a possible solution?

Xavier Guihot
  • 54,987
  • 21
  • 291
  • 190
SarahB
  • 318
  • 1
  • 4
  • 18
  • I believe that in Eclipse worksheets are evaluated automatically when the file is saved. – davidrpugh Apr 10 '17 at 06:57
  • @davidrpugh: But its not working. I save and it doesn't work – SarahB Apr 10 '17 at 07:32
  • What is your project name? Does it have a space? Came across this [SO](https://stackoverflow.com/questions/24230840/new-scala-worksheets-not-evaluated-in-eclipse/30999391#30999391) post which might be relevant. – davidrpugh Apr 10 '17 at 08:06
  • @davidrpugh, no there is no space. I did check that post too. Thanks anyway. – SarahB Apr 10 '17 at 08:40
  • What versions of Scala, Sbt, and Eclipse are you using? – davidrpugh Apr 10 '17 at 08:41
  • @davidrpugh, I have added the system and other details in my question. Thank you. – SarahB Apr 10 '17 at 09:42
  • Can you open a terminal from within Eclipse and type `sbt console` which should return a Scala prompt at which you can then type simple commands? – davidrpugh Apr 10 '17 at 10:45
  • @davidrpugh: That is working fine, I can do that at the sbt > console. However, having used scala worksheet before in windows os, I wanted to now use the same in unix. It looks like it will take a few years before scala can reach to the scale of Java. – SarahB Apr 10 '17 at 11:07
  • I don't have much experience using Scala from Eclipse (I mostly use Intellij). Is this the [Eclipse](http://scala-ide.org/download/sdk.html) plugin that you are using? What version of Scala is specified in your `build.sbt` file? – davidrpugh Apr 10 '17 at 12:15
  • Presumably you also saw this [tutorial](http://scala-ide.org/docs/current-user-doc/gettingstarted/index.html) video? – davidrpugh Apr 10 '17 at 12:20
  • @davidrpugh: the scalaVersion := "2.11.5". I will try to use Intellij, to see if that works fine. I did see the video which you mentioned, but to no effect. – SarahB Apr 11 '17 at 11:38
  • Looks like the version numbers for the Scala plugin are quite specific: Scala 2.11.8 and Scala 2.10.6. I would kind of be surprised if a simple version bump sorts out your problem. But try changing the version in your `build.sbt` to 2.11.8 and see what happens... – davidrpugh Apr 11 '17 at 11:40
  • @davidrpugh: It works perfectly in Intellij. I have used only eclipse for Java. I guess its time I moved on from it. Thank you so much. PS: I did try your suggestion, it didn't work, I restarted eclipse but still no effect. – SarahB Apr 11 '17 at 16:15
  • In my configuration, at least, no errors are reported if I write some code that throws an exception. I find it unusable. You might want to comment out all your code, and start with something idiot-proof, like `val n = 1`. – AbuNassar Jun 01 '17 at 21:54

0 Answers0