scala crashes right after launch

Bug #2012334 reported by Kerne MacDonald Fahey
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
scala (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When I launch /usr/bin/scala with no arguments, it presents this welcome like I assume is normal:

```
Welcome to Scala 2.11.12 (OpenJDK 64-Bit Server VM, Java 19.0.2).
Type in expressions for evaluation. Or try :help.
```

And then a few seconds later it crashes with a very long java stack trace:

```
Welcome to Scala 2.11.12 (OpenJDK 64-Bit Server VM, Java 19.0.2).
Type in expressions for evaluation. Or try :help.
Exception in thread "Thread-1" java.lang.NoClassDefFoundError: org/fusesource/jansi/AnsiOutputStream
 at jline.internal.Ansi.stripAnsi(Ansi.java:28)
 at jline.console.ConsoleReader.setPrompt(ConsoleReader.java:499)
 at jline.console.ConsoleReader.readLine(ConsoleReader.java:2425)
 at jline.console.ConsoleReader.readLine(ConsoleReader.java:2378)
 at jline.console.ConsoleReader.readLine(ConsoleReader.java:2366)
 at scala.tools.nsc.interpreter.jline.InteractiveReader.readOneLine(JLineReader.scala:59)
 at scala.tools.nsc.interpreter.InteractiveReader$class.readLine(InteractiveReader.scala:38)
 at scala.tools.nsc.interpreter.jline.InteractiveReader.readLine(JLineReader.scala:27)
 at scala.tools.nsc.interpreter.SplashReader.readLine(InteractiveReader.scala:142)
 at scala.tools.nsc.interpreter.SplashLoop.run(InteractiveReader.scala:71)
 at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: java.lang.ClassNotFoundException: org.fusesource.jansi.AnsiOutputStream
 at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
 at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
 at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
 ... 11 more

Failed to initialize compiler: NoClassDefFoundError.
This is most often remedied by a full clean and recompile.
Otherwise, your classpath may continue bytecode compiled by
different and incompatible versions of scala.

java.lang.NoClassDefFoundError: org/fusesource/jansi/AnsiOutputStream
 at jline.internal.Ansi.stripAnsi(Ansi.java:28)
 at jline.console.ConsoleReader.setPrompt(ConsoleReader.java:499)
 at jline.console.ConsoleReader.readLine(ConsoleReader.java:2425)
 at jline.console.ConsoleReader.readLine(ConsoleReader.java:2378)
 at jline.console.ConsoleReader.readLine(ConsoleReader.java:2366)
 at scala.tools.nsc.interpreter.jline.InteractiveReader.readOneLine(JLineReader.scala:59)
 at scala.tools.nsc.interpreter.InteractiveReader$class.readLine(InteractiveReader.scala:38)
 at scala.tools.nsc.interpreter.jline.InteractiveReader.readLine(JLineReader.scala:27)
 at scala.tools.nsc.interpreter.ILoop.readOneLine(ILoop.scala:413)
 at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:425)
 at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply$mcZ$sp(ILoop.scala:993)
 at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:891)
 at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:891)
 at scala.reflect.internal.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:97)
 at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:891)
 at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:74)
 at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:87)
 at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:98)
 at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:103)
 at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
Caused by: java.lang.ClassNotFoundException: org.fusesource.jansi.AnsiOutputStream
 ... 20 more
```

That's it, that's the entire problem. It's pretty dire though.

ProblemType: Bug
DistroRelease: Ubuntu 22.10
Package: scala 2.11.12-5
ProcVersionSignature: Ubuntu 5.19.0-35.36-generic 5.19.17
Uname: Linux 5.19.0-35-generic x86_64
ApportVersion: 2.23.1-0ubuntu3
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: XFCE
Date: Mon Mar 20 20:38:32 2023
InstallationDate: Installed on 2022-12-24 (86 days ago)
InstallationMedia: Xubuntu 18.04.5 LTS "Bionic Beaver" - Release amd64 (20200806.1)
PackageArchitecture: all
SourcePackage: scala
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Kerne MacDonald Fahey (kerne-m-fahey) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in scala (Ubuntu):
status: New → Confirmed
Revision history for this message
Petr Skovron (xofon) wrote :

Workaround:

# apt-get install libjansi1-java
# cd /usr/share/scala-2.11/lib
# mv jansi.jar jansi.jar--
# ln -s /usr/share/java/jansi1.jar jansi.jar

Background: /usr/share/scala-2.11/lib/jansi.jar is a softlink to /usr/share/java/jansi.jar, which is v2.4.0. In this version some classes were moved to a different namespace:
https://github.com/fusesource/jansi/commit/04d771c3c7f2a4c29301191e65e7ce3cdeb92918

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.