Home > database >  Installing scala from coursier: where is the `scala` command?
Installing scala from coursier: where is the `scala` command?

Time:09-25

I installed scala from https://www.scala-lang.org/download/scala3.html using the coursier option:

cs install scala3-compiler
cs install scala3-repl

After these two steps, I have two binaries in my $PATH: scala3-compiler and scala3-repl.

I am learning scala from the Programming in Scala book, and in Chapter 4, it said I should compile and run a scala application with the following commands:

scalac ChecksumAccumulator.scala Summer.scala
scala Summer of love

I replaced scalac with scala3-compiler in the first command, and it produced an org directory of the following structure:

org/
└── stairwaybook
    └── classesandobjects
        ├── ChecksumAccumulator$.class
        ├── ChecksumAccumulator.class
        ├── ChecksumAccumulator.tasty
        ├── Summer$.class
        ├── Summer.class
        └── Summer.tasty

But I cannot find any scala command installed in my system, and do not know how to run the compiled bytecodes. Any thoughts or suggestions?

CodePudding user response:

Try to install:

cs install scala3

Then you should write:

scala3-compiler ChecksumAccumulator.scala Summer.scala
scala3 Summer of love 

It should work

  • Related