[Resolved] No "Run" option for Scala in Intellij IDEA CE 2018.1.

I have followed instructions from https://docs.scala-lang.org/getting-started-intellij-track/getting-started-with-scala-in-intellij.html  (java 1.8, scala plugin v2018.1.8)

to get started with Scala. The problem is that the Run Configurations are empty and I can only compile the code (IDEA project model; but the same is true for sbt), no option to run it. Under "Edit configurations" there is: Scala Console, Scala Script, Scala Test.

Which one I should configure and how?

Thank you.


p.s. I'm on Windows 10

[Update]: The problem was on my side. The JDK was not in the system path.


评论操作 固定链接

This does not fix this for me, I and many others have the same issue. For me I'm on Ubuntu 18:04 All sources paths compilers are set, creating a new Scala Project with Intellij template (not lightable or sbt) following tutorials and there is no Option to run a Singleton (Object) class or any script. Im beginning to think this is a bug (which was opened several releases ago) yet Intellij has no fixes.

object Test {
def main(args:Array[String]) =println("Hello World")

No run option available anywhere, no default run config. This is the same with several users in our dev group.

And before you ask again

  • JDK fine on system path
  • SCALA COMPILER correct
  • src filder marked as sources root
  • project setup correctly (with the Intellij new project wizard)

In fact it appears as if the issue is even deeper. Both new SBT projects and IntelliJ projects load the sdks but neither are able to run a Straight Scala File. In fact this reffirms the issue lies with IntelliJ

As a new SBT Scala project:

class Main {
def main(args: Array[String]): Unit = {
println("Hello World!")

No run option

评论操作 固定链接

The problem in my case was installed options. When I have installed Intelij I didn't choose Scala plugin third screen ( under featured plugins option when installing IDE). Later didn't help when I installed manually plugin as if Intelij is not detecting plugin the same was as the featured plugin... So reinstall helped with featured plugin checked this time!

评论操作 固定链接

Same issue here on mac.  The resolution for me was because the SDK was pointing an old java SDK directory.
Also the Global Libraries was pointing to an old Scala install dir.
Set these on the first page  under the "Configure -> "Structure for New Projects".
The re-open the project let the IDE pick up the new setting and then the menu option was extended with the new options for running.

评论操作 固定链接

On IntelliJ IDEA CE 2020.1, I solved this problem by changing the Project SDK from the default embedded Jet Brains Runtime SDK (which was in version 11) to an Oracle JDK I had installed myself (which was in version 1.8.0_221).