Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala REPL no echo on input

Tags:

scala

sbt

There is a very strange problem with my scala REPL these days that it doesn't echo any input in the terminal.

Tried to remove ~/.sbt but didn't work. Using Ubuntu 18.04 and sbt 1.15.

Any one has similar issues?

like image 578
peidaqi Avatar asked May 28 '18 13:05

peidaqi


2 Answers

Had the same issue after upgrading to Ubuntu 18.04. It seems certain Scala versions including 2.11.12 aren't compatible. I was able to get the REPL working properly on version 2.11.8.

To get that version use the following commands:

$ sudo apt-get remove scala-library scala
$ sudo wget www.scala-lang.org/files/archive/scala-2.11.8.deb
$ sudo dpkg -i scala-2.11.8.deb
like image 157
Peter Fitch Avatar answered Sep 22 '22 03:09

Peter Fitch


This seems to be an issue with JLine2 being built with JDK9+, but being used on JDK8. If you're on bionic, try this PPA for jline2: https://launchpad.net/~lokkju/+archive/ubuntu/java-compat/

(or just download and install https://launchpad.net/~lokkju/+archive/ubuntu/java-compat/+build/16458066/+files/libjline2-java_2.14.6-1ubuntu1~bionicppa1_all.deb via dpkg)

You can verify jline2 is the problem by running scala -Ydebug, and looking for ByteBuffer class not found error.

I've also submitted bugs to hopefully address this issue in the future.

like image 43
Loki Avatar answered Sep 25 '22 03:09

Loki