title: How to run Main method in Scala in Intellij
body: <p>I am trying to get a main method to run in Scala in Intellij, but it is not working, and I don't know why.</p>
  
  <p>File structure looks like this...</p>
  
  <pre><code>.
  ├── cse116.iml
  ├── pom.xml
  ├── src
  │   ├── Main.scala
  └── target
      └── classes
  </code></pre>
  
  <p>Main.scala looks like this...</p>
  
  <pre><code>object Main {
    def main(args: Array[String]): Unit = {
      println("Hello, world!")
    }
  }
  </code></pre>
  
  <p>When I try to do "Run" on Intellij, I get the following error:</p>
  
  <p>Error: Could not find or load main class Main</p>
  
  <p>I am not sure what configuration is messed up. What may be some common reasons for this happening?</p>