Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No docs on how to specify the main class for project #1048

Open
arbitrary-dev opened this issue Oct 27, 2021 · 1 comment
Open

No docs on how to specify the main class for project #1048

arbitrary-dev opened this issue Oct 27, 2021 · 1 comment

Comments

@arbitrary-dev
Copy link

steps

scala/scala-lang#1287

$ sbt new scala/scala3.g8
$ 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

problem

Were unable to find in https://www.scala-sbt.org/1.x/docs/Running.html or elsewhere there information on how to properly specify the main class.

expectation

I go to https://www.scala-sbt.org/1.x/docs/Running.html and it's day clear how to specify the main class to be able to sbt run.

notes

:(

@arbitrary-dev
Copy link
Author

The original issue was due to not following the go to the generated folder instruction.

Still no easy way to find out in docs, how to specify defferent main class.

Especially for Scala 3 which have main functions:

@main def hello: Unit = 

@xuwei-k xuwei-k transferred this issue from sbt/sbt Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant