Skip to content

Create a project and use Scala 3 (SBT) #1287

@arbitrary-dev

Description

@arbitrary-dev

Expected

https://www.scala-lang.org/download/scala3.html

To create a new Scala 3 project, go to your terminal and run sbt new scala/scala3.g8.

After entering the name of your project (let's say MyProject), in your terminal go to the generated folder (for example myproject) and run the command sbt run.

You should be greeted with a friendly message.

Actually

$ sbt run
[info] welcome to sbt 1.4.5 (Gentoo Java 11.0.10)
[info] loading settings for project global-plugins from deps.sbt,scalafmt.sbt ...
[info] loading global plugins from /home/man/.sbt/1.0/plugins
[info] loading project definition from /home/man/projects/scala3-sample/project
[info] set current project to scala3-sample (in build file:/home/man/projects/scala3-sample/)
[error] java.lang.RuntimeException: No main class detected.
[error] 	at scala.sys.package$.error(package.scala:30)
[error] stack trace is suppressed; run last Compile / bgRun for the full output
[error] (Compile / bgRun) No main class detected.
[error] Total time: 0 s, completed Oct 27, 2021, 12:53:18 PM

Scala 2

The same issue with Scala 2 guide for SBT.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions