Ra Ka
Ra Ka

Reputation: 3055

Restart PlayConsole SBT server

I'm running a scala playframework app using sbt run on intellij console. However, I exited the server using ctrl+Z instead of ctrl+D. Now, I try to sbt sbt run again, but I'm getting following exception:

java.net.BindException: Address already in use

The port is already in use. That means, previous server did not exited. If I try sbt run with different port sbt run 9999 other than default 9000, the server starts without any exception. So, is there any way to restart or end previous session so that I will not get any binding failed exception if I run the project again?

Upvotes: 0

Views: 1057

Answers (1)

koiralo
koiralo

Reputation: 23099

You have another process already on that port you are using. You need to kill it or use another port.

You can list the process that are using the port and then kill them

use lsof -i:portnumber(8080)

Then kill the process using that port kill PID

Hope this helps!

Upvotes: 4

Related Questions