Scala console won't work, IntelliJ

2020-02-18 03:26发布

问题:

I did all the preference work, installed scala, everything works except this, i just can not test a scala class in the console window.

In tutorials I see they just type in something behind the scala> but it just won't work, i can type some random stuff there below which doesn't do anything when I press enter.

Can you guys help me out? I would be very thankful. Cheers

回答1:

Once you type on the Scala console in IntelliJ Community Edition. Hit Ctrl+Enter instead of enter to execute.

took me a while to get around it :)

IntelliJ & Working with Scala Worksheet



回答2:

If you want the console to execute when you hit enter, go to Preferences > Keymap > Plug-ins > Scala, and right-click ScalaConsole.Execute. Select Add Bookmark and hit enter in the first box. Then click Apply and then OK.



回答3:

You have to press ⌘-Enter on Mac OS X when you're done typing.



回答4:

I guess it's better to change the message from "Type in expressions to have them evaluated." to "Type in expressions and press Ctrl + Enter to have them evaluated."



回答5:

Just add scala sources to $PATH and it should be available / callable from CMD / Idea Terminal