1. 程式人生 > >scala在cmd模式下執行檔案報:1: error: ';' expected but '.' found. scalac C:\hello.scala 錯誤

scala在cmd模式下執行檔案報:1: error: ';' expected but '.' found. scalac C:\hello.scala 錯誤

scala在cmd模式下執行檔案報<console>:1: error: ';' expected but '.' found.        scalac C:\hello.scala 錯誤:

具體見圖:

     

     


按照如下方式即可執行:

首先我的scala安裝在:D:\Program Files\scala

具體操作見截圖:


或者使用 :load 命令:


具體解釋參考:http://stackoverflow.com/questions/22424539/how-can-i-get-scala-to-work-in-the-command-line