vs code上配置Scala

转自:https://www.cnblogs.com/steven-yang/p/5852988.html

百度的结果表达太奇怪,简单记一笔。

1、下载一个scala的压缩包,https://www.scala-lang.org/download/

2、配置环境变量

3、新建一个文件夹作为工作区。

4、新建.vscode文件夹并保存一份tasks.json文件,内容如下:

{
    "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}"
            ]
        }
    ]
}

5、打开vs code,选择打开文件夹。

6、新建一个*.scala文件,Ctrl+Shift+B就能跑啦!

最终得到:

 

posted on 2018-07-11 20:09  Moral  阅读(2145)  评论(0编辑  收藏  举报

导航