File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Android Security Essentials Live Lessons this week in the Android 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: 3068

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.
Similar Threads
Hadoop key mismatch
Help with setting up Tomcat 6.018 for Python scripts
Lottery GUI
JMSAdmin tool problem
questions about Process and Runtime()