1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Scala 環境構築 VSCode+Metals

Posted at

この記事について

VSCode環境でScalaの原始的なプログラムを実行するまでの手順です。

Scalaのインストール

Scalaの公式サイトのインストーラーからインストールします。

インストーラーによるインストールが完了したら、cs setup コマンドで関連ツールのインストールを行います。

プロジェクトの作成

対象のディレクトリでsbtコマンドを使ってプロジェクトを作成します。

Scala3の場合はsbt new scala/scala3.g8です。直後にプロジェクト名を要求されますので入力します。

プログラムの実行

※VSCode, Metalsはインストール済みであることを前提とします。

VSCodeでプロジェクトディレクトリを開き、Main.scalaを開きます。
@の上くらいにrunがあるのでクリックすると実行されます。

image.png

Terminalに結果が出力されます。

image.png

以上です。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?