I’m trying to run HelloWorld sample with scala 2.9.1 final on Windows XP:
object HelloWorld extends App {
println("Hello, World!")
}
File is saved as Hello.scala.
When I run scalac Hello.scala, it’s ok.
When I run scala Hello, it writes:
"Exception in thread "main" java.lang.RuntimeException: Cannot figure out how to run target"
It’s ridiculous, my echo %PATH% contains:
C:\Program Files\Java\jdk1.6.0_25\bin;
C:\Program Files\Java\jdk1.6.0_25\jre\lib;
C:\Program Files\Java\jdk1.6.0_25\lib;
C:\Program Files\scala\bin
so everything seems to be in classpath.
Running scala -classpath "%PATH%;." Hello doesn’t help either.
Please help.
Shouldn’t it be
scala HelloWorld?I can repro your problem on Mac too:
scalaexpects either a class name or a source name.scala Hellodoesn’t resolve to either of them.