The scalac command, which is similar to javac command, compiles one or more Scala source files and generates a bytecode as output, which then can be executed on any Java Virtual Machine. To compile your hello world object, use the following:
> scalac HelloWorld.scala
By default, scalac generates the class files into the current working directory. You may specify a different output directory using the -d option:
> scalac -d classes HelloWorld.scala
However, note that the directory called classes must be created before executing this command.