Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala REPL does not work on Ubuntu

When trying to use the scala interpreter in the terminal I am experiencing a weird issue, when I try to write, the cursor does not move, although after I press enter it "works".

This is what I should see:

Welcome to Scala 2.11.12 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_171).
Type in expressions for evaluation. Or try :help.

scala> val x = 1
x: Int = 1

This is what I actually see:

Welcome to Scala 2.11.12 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_171).
Type in expressions for evaluation. Or try :help.

scala> x: Int = 1

All in all, I cannot see what I write.

This only happens with this interpreter, every other program/functionality from the terminal seems to be working just fine.

It happened after I upgraded to 18.04 and replaced the JVM to 8.

like image 350
Bruno Fischetti Avatar asked May 14 '18 15:05

Bruno Fischetti


People also ask

How do I start scala REPL?

We can start Scala REPL by typing scala command in console/terminal.

Does scala have a REPL?

The Scala REPL is a tool (scala) for evaluating expressions in Scala. The scala command will execute a source script by wrapping it in a template and then compiling and executing the resulting program.


1 Answers

After I upgraded to Scala 2.12.6 it started working again.

Welcome to Scala 2.12.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_171).
Type in expressions for evaluation. Or try :help.

scala> val nowISeeWhatIWrite = true
nowISeeWhatIWrite: Boolean = true

Still not sure why the older version stopped working.

like image 78
Bruno Fischetti Avatar answered Oct 17 '22 04:10

Bruno Fischetti