configure run in eclipse for Scala

后端 未结 14 1709
自闭症患者
自闭症患者 2021-01-30 16:03

I am a beginner in Scala. I installed Scala IDE in eclipse and now I want to run my application programme. It never shows \"run as Scala application\", instead it shows \"run

相关标签:
14条回答
  • 2021-01-30 16:50

    I had this issue using an Eclipse Luna Scala IDE. No of the above solution made it possible to compile my Main.scala file.

    package main.scala
    
    object Main {
      def main(args: Array[String]){
        println("Hello, I am the main object")
      }
    }
    

    The problem was the following: My project only referenced the JRE System library but no Scala library. I carried out the following steps:

    1. Right click on project properties
    2. Java Build Path
    3. Check if the Scala library is missing
    4. Click "Add Library..."
    5. Add the desired Scala library that should have been shipped with the Scala IDE.

    Then, go to the Main.scala file that is lying somewhere in your project folder and contains your main function. If you right-click file, "Scala Application" should appear under "Run as".

    0 讨论(0)
  • 2021-01-30 16:51

    Right click on the Project --> Click on Run Configurations --> In the Run Configurations window select the "Scala Application"

    0 讨论(0)
提交回复
热议问题