Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.11.7, Scala 2.12.0-M1, Scala 2.12.0-M2
    • Fix Version/s: Backlog
    • Component/s: Repl / Interpreter
    • Labels:
    • Environment:

      Windows 7 Enterprise (64 bit), Cygwin 2.2.0, Java 1.8.0_51 64 bit Server, SBT 0.13.8

      Description

      After upgrading to Scala 2.11.7 on Windows, the REPL when started using sbt console does not display the user's input when typing anymore. Only after pressing ENTER, one can see the result of evaluating the input (but not the input itself).

      I guess this problem is somehow related to https://github.com/scala/scala/pull/4563, so I addded -Ydebug to scalacOptions. The output seems to confirm that the REPL cannot find the embedded JLine interpreter.

      > console
      [info] Starting scala interpreter...
      [info]
      Trying to instantiate a InteractiveReader from scala.tools.nsc.interpreter.jline
      .InteractiveReader
      Trying to instantiate a InteractiveReader from scala.tools.nsc.interpreter.jline
      _embedded.InteractiveReader
      All InteractiveReaders tried:
        - scala.tools.nsc.interpreter.jline.InteractiveReader --> java.lang.reflect.In
      vocationTargetException
              sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
      ccessorImpl.java:62)
              sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
      tructorAccessorImpl.java:45)
              java.lang.reflect.Constructor.newInstance(Constructor.java:422)
              scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$$an
      onfun$76(ILoop.scala:856)
              scala.tools.nsc.interpreter.ILoop$$Lambda$1448/1176529533.apply(Unknown
      Source)
              scala.tools.nsc.interpreter.ILoop.mkReader$1(ILoop.scala:862)
              scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$$an
      onfun$80(ILoop.scala:866)
              scala.tools.nsc.interpreter.ILoop$$Lambda$1447/1284017825.apply(Unknown
      Source)
              scala.util.Try$.apply(Try.scala:211)
              scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$$an
      onfun$79(ILoop.scala:866)
              scala.tools.nsc.interpreter.ILoop$$Lambda$1446/1557843730.apply(Unknown
      Source)
              scala.collection.immutable.Stream.map(Stream.scala:418)
              scala.tools.nsc.interpreter.ILoop.chooseReader(ILoop.scala:866)
              scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$$an
      onfun$86(ILoop.scala:907)
              scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$$an
      onfun$85(ILoop.scala:907)
              scala.tools.nsc.interpreter.ILoop$$Lambda$1436/1142893085.apply$mcZ$sp(U
      nknown Source)
              scala.runtime.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:12)
              scala.reflect.internal.util.ScalaClassLoader$.savingContextLoader(ScalaC
      lassLoader.scala:125)
              scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:902)
              scala.tools.nsc.interpreter.ILoop.main(ILoop.scala:927)
              xsbt.ConsoleInterface.run(ConsoleInterface.scala:62)
              sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
      a:62)
              sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
      Impl.java:43)
              java.lang.reflect.Method.invoke(Method.java:497)
              sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:101)
              sbt.compiler.AnalyzingCompiler.console(AnalyzingCompiler.scala:76)
              sbt.Console.sbt$Console$$console0$1(Console.scala:22)
              sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply$mcV$sp(Console.scala
      :23)
              sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply(Console.scala:23)
              sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply(Console.scala:23)
              sbt.Logger$$anon$4.apply(Logger.scala:85)
              sbt.TrapExit$App.run(TrapExit.scala:248)
              java.lang.Thread.run(Thread.java:745)
       
        - scala.tools.nsc.interpreter.jline_embedded.InteractiveReader --> java.lang.C
      lassNotFoundException: scala.tools.nsc.interpreter.jline_embedded.InteractiveRea
      der
              java.net.URLClassLoader.findClass(URLClassLoader.java:381)
              java.lang.ClassLoader.loadClass(ClassLoader.java:424)
              java.lang.ClassLoader.loadClass(ClassLoader.java:357)
              java.lang.Class.forName0(Native Method)
              java.lang.Class.forName(Class.java:264)
              scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$$an
      onfun$76(ILoop.scala:855)
              scala.tools.nsc.interpreter.ILoop$$Lambda$1448/1176529533.apply(Unknown
      Source)
              scala.tools.nsc.interpreter.ILoop.mkReader$1(ILoop.scala:862)
              scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$$an
      onfun$80(ILoop.scala:866)
              scala.tools.nsc.interpreter.ILoop$$Lambda$1447/1284017825.apply(Unknown
      Source)
              scala.util.Try$.apply(Try.scala:211)
              scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$$an
      onfun$79(ILoop.scala:866)
              scala.tools.nsc.interpreter.ILoop$$Lambda$1446/1557843730.apply(Unknown
      Source)
              scala.collection.immutable.Stream.map(Stream.scala:418)
              scala.collection.immutable.Stream.scala$collection$immutable$Stream$$$an
      onfun$5(Stream.scala:418)
              scala.collection.immutable.Stream$$Lambda$1465/891606772.apply(Unknown S
      ource)
              scala.collection.immutable.Stream$Cons.tail(Stream.scala:1187)
              scala.collection.immutable.Stream$Cons.tail(Stream.scala:1177)
              scala.collection.immutable.Stream.collect(Stream.scala:435)
              scala.tools.nsc.interpreter.ILoop.chooseReader(ILoop.scala:868)
              scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$$an
      onfun$86(ILoop.scala:907)
              scala.tools.nsc.interpreter.ILoop.scala$tools$nsc$interpreter$ILoop$$$an
      onfun$85(ILoop.scala:907)
              scala.tools.nsc.interpreter.ILoop$$Lambda$1436/1142893085.apply$mcZ$sp(U
      nknown Source)
              scala.runtime.java8.JFunction0$mcZ$sp.apply(JFunction0$mcZ$sp.java:12)
              scala.reflect.internal.util.ScalaClassLoader$.savingContextLoader(ScalaC
      lassLoader.scala:125)
              scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:902)
              scala.tools.nsc.interpreter.ILoop.main(ILoop.scala:927)
              xsbt.ConsoleInterface.run(ConsoleInterface.scala:62)
              sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
      a:62)
              sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
      Impl.java:43)
              java.lang.reflect.Method.invoke(Method.java:497)
              sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:101)
              sbt.compiler.AnalyzingCompiler.console(AnalyzingCompiler.scala:76)
              sbt.Console.sbt$Console$$console0$1(Console.scala:22)
              sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply$mcV$sp(Console.scala
      :23)
              sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply(Console.scala:23)
              sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply(Console.scala:23)
              sbt.Logger$$anon$4.apply(Logger.scala:85)
              sbt.TrapExit$App.run(TrapExit.scala:248)
              java.lang.Thread.run(Thread.java:745)
      

      What is odd is that the same behavior occurs when starting the REPL directy by running scala inside Cygwin, but not when running scala inside the Windows command line (although the debug output looks the same), whereas the problem occurs under both environments when the REPL is launched from within SBT using console.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ummels Michael Ummels
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: