7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Scala:複数Mainクラスから実行するものを指定したい

Posted at

Mainクラスが複数あると、sbtでrunすると候補が出てきて、その中から数字で選択しないといけません…。

> run
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list

Multiple main classes detected, select one to run:

 [1] playground.actor.example1.SimpleExample
 [2] playground.actor.example2.ChatModelExample
 [3] playground.actor.example3.ActorLoggingExample
 [4] playground.basic.HelloWorld

これが地味にめんどくさいです。

そんなときはrunMainを使いましょう。クラス名の補完も効いて便利です。

> runMain playground.basic.HelloWorld
[info] Running playground.basic.HelloWorld
Hello World!!!
[success] Total time: 0 s, completed 2015/08/13 12:28:31
7
6
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
7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?