This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Scala and the fly likes Problem running Scala Script file from the terminal. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Languages » Scala
Bookmark "Problem running Scala Script file from the terminal." Watch "Problem running Scala Script file from the terminal." New topic

Problem running Scala Script file from the terminal.

Sandip Bandyopadhyay

Joined: Feb 04, 2012
Posts: 1
I am new to Scala. I have installed Scala 2.9 from the repository on Ubuntu 12.04. My Scala REPL is working perfect. I have compiled scala file perfectly but when I tried to run a simple script file [println ("Hello")] with -------> "scala Test.scala" I got the following error.
Exception in thread "main" java.lang.RuntimeException: Cannot figure out how to run target: Test.scala
at scala.sys.package$.error(package.scala:27)
at scala.Option.getOrElse(Option.scala:108)

Please help me to get rid of this error. Thanking you in advance.

Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3119

what are the contents of Test.scala?

I tried this:

then ran Test.scala using scala Test.scala and it works fine.

PS: I tried this on Windows, but I believe the platform shouldn't really matter.

Mohamed Sanaulla | My Blog
I agree. Here's the link:
subject: Problem running Scala Script file from the terminal.