Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to launch Scala from prompt

Tags:

scala

I downloaded Scala from http://www.scalalang.org/downloads and I would like to start to do simple program starting from prompt and using the interpreter.

Could you explain step by step how I can launch a simple Hello World

Thanks

like image 272
Frank Pentangeli Avatar asked Sep 24 '16 15:09

Frank Pentangeli


1 Answers

To launch a prompt

add the scala's bin directory to $PATH variable and type scala command.

Simple script

#!/usr/bin/env scala
println("Hello World")

Save it as hello.scala

chmod +x hello.scala

./hello.scala
#or 
scala hello.scala
like image 100
Thamme Gowda Avatar answered Oct 21 '22 10:10

Thamme Gowda