aspose file tools*
The moose likes Scala and the fly likes Error encountered for scala script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Scala
Bookmark "Error encountered for scala script" Watch "Error encountered for scala script" New topic
Author

Error encountered for scala script

swapnil nawale
Greenhorn

Joined: Sep 01, 2010
Posts: 3
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Sep 01, 2010
Posts: 3
Thanks David Newton. My silly mistake. I came out of REPL and was able to run script successfully.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Glad you worked it out :) And welcome to JavaRanch!
Marimuthu Madasamy
Ranch Hand

Joined: Jun 07, 2007
Posts: 72

@swapnil nawale: Just for your information: within REPL, you can load and interpret a scala file with ':load' option:



- Marimuthu Madasamy
swapnil nawale
Greenhorn

Joined: Sep 01, 2010
Posts: 3
Thanks David Newton . And thanks to Marimuthu Madasamy also for extra piece of information
 
 
subject: Error encountered for scala script