2
votes

I have a "Scala/Simple module with attached Scala SDK" type project in IntelliJIDEA with which I was easily able to build and setup a couple of application configurations. A Scala workspace also works fine, but when I try to create and run a Scala Console configuration the terminal comes up, the Scala Repl appears to run fine, in that it gives me the Welcome to Scala message and prints an initial "scala>". However, although autocompletion works, the Repl otherwise appears dead to the world: nothing is returned or printed, and when I restarted and entered a one-liner to write some text to a file to test if it was just an ouptut-capture issue, that file did not appear.

I am running IntelliJIDEA 15.0.2 / idea-IU-143.1184.17 on Debian.

When I copy the command being run by IntelliJIDEA and run from a console, it works fine; command copied from IntelliJIDEA Scala Console follows:

/usr/lib/jvm/java-7-openjdk-amd64/bin/java -Djline.terminal=NONE -Didea.launcher.port=7543 -Didea.launcher.bin.path=/usr/local/idea-IU-143.1184.17/bin -Dfile.encoding=UTF-8 -classpath /home/pacs/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.7.jar:/home/pacs/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.11.7.jar:/home/pacs/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.11.7.jar:/home/pacs/.IntelliJIdea15/config/plugins/Scala/lib/scala-plugin-runners.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/compilefontconfig.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/dnsns.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/icedtea-sound.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/java-atk-wrapper.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext/zipfs.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/javazic.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/management-agent.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rhino.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar:/home/pacs/IdeaProjects/scap/out/production/scap:/usr/local/idea-IU-143.1184.17/lib/idea_rt.jar com.intellij.rt.execution.application.AppMain org.jetbrains.plugins.scala.compiler.rt.ConsoleRunner -usejavacp

I'm rather new to the JetBrains family of IDEs so I may be missing something obvious; does anyone have any ideas?

EDIT: I tried this on IntelliJIDEA 15.0.0 on OS X with scala 2.10.6 and JDK 1.8 with the same result so I am inclined to believe this is not a JDK, Scala, or OS-specific problem.

1

1 Answers

4
votes

OK, finally figured this out: it's not a normal console where you press enter; instead you use whatever keymap goes to Plug-ins/Scala/Execute Console Statement-- probably Ctrl+Enter or ⌘+Enter.

Other people seem to have been stumped also:

Scala console won't work, IntelliJ

The IntelliJIDEA console is very nice once you know this; with autocompletion, auto-formatting, and no issues with multiline code. If I had one request though, it would be to ask the JetBrains team to please add something to the Scala Console welcome message which indicates that this is not a normal console and maybe a quick hint on how to use it.