vs code上配置Scala

轉自:https://www.cnblogs.com/steven-yang/p/5852988.htmlhtml

百度的結果表達太奇怪,簡單記一筆。linux

一、下載一個scala的壓縮包,https://www.scala-lang.org/download/json

二、配置環境變量windows

三、新建一個文件夾做爲工做區。ui

四、新建.vscode文件夾並保存一份tasks.json文件,內容以下:spa

{ "version": "0.1.0", "isShellCommand": true, "args": [], "showOutput": "always", "echoCommand": true, "suppressTaskName": true, "windows": { "command": "cmd", "args": [ "/C", "scala" ] }, "linux": { "command": "sh", "args": [ "scala" ] }, "osx": { "command": "sh", "args": [ "scala" ] }, "tasks": [ { "taskName": "run script", "isBuildCommand": true, "args": [ "${file}" ] } ] }

五、打開vs code,選擇打開文件夾。scala

六、新建一個*.scala文件,Ctrl+Shift+B就能跑啦!code

最終獲得:htm

相關文章
相關標籤/搜索