Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error encountered for scala script

 
swapnil nawale
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am the newbie trying out to learn Scala. But I got stumped in the very first Hello World Program.
Following is the simple program "HelloWorld.scala" that I am trying to run :



I am able to get the result if I use above code on command line. But, when I try to run this code in the script , I am getting following error :



I am not able to figure out the reason for this error. Kindly help me out to know the solution.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works fine for me.

Oh, wait; why are you trying to run "scala" when you're already in scala??? Exit out of the REPL first.
 
swapnil nawale
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David Newton. My silly mistake. I came out of REPL and was able to run script successfully.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad you worked it out :) And welcome to JavaRanch!
 
Marimuthu Madasamy
Ranch Hand
Posts: 72
Java Monad Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@swapnil nawale: Just for your information: within REPL, you can load and interpret a scala file with ':load' option:

 
swapnil nawale
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David Newton . And thanks to Marimuthu Madasamy also for extra piece of information
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic