Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I quit sbt run correctly?

Tags:

scala

sbt

After sbt run, a project I'm working on is showing some errors/warnings, and seems to pause.

How do I quit sbt from here?

If I press ctrl+z or ctrl+c, it stops, but the next time I run sbt it says:

[warn] sbt server could not start because there's another instance of sbt running on this build.

Running multiple instances is unsupported

So how do I (force?) quit correctly after sbt run?

like image 630
Gimme the 411 Avatar asked Oct 18 '25 13:10

Gimme the 411


2 Answers

In build.sbt:

fork in run := true
like image 161
amer Avatar answered Oct 20 '25 03:10

amer


Since the comments on the accepted answer say it didn't work for you I'll offer another workaround.

You can always kill running instances of sbt server by looking for java processes (SBT runs within the JVM) and killing them.

pgrep -a java to list PIDs of all java processes.

kill -9 {PID} to kill a process by PID.

Or just open Activity Monitor/Resource Monitor and kill process with Process Name "java".

like image 28
Nunchucks Avatar answered Oct 20 '25 05:10

Nunchucks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!