Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

I'm getting an error it says spart.Spark - ignite failed

I get this error when I try to run my code please help. [Thread-1] ERROR spark.Spark - ignite failed java.net.BindException: Address already in use: bind at sun.nio.ch.Net.bind0(Native Method) at sun.nio.ch.Net.bind(Net.java:433) at sun.nio.ch.Net.bind(Net.java:425) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:298) at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.server.Server.doStart(Server.java:431) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at spark.embeddedserver.jetty.EmbeddedJettyServer.ignite(EmbeddedJettyServer.java:130) at spark.Service.lambda$init$2(Service.java:504) at java.lang.Thread.run(Thread.java:748)

Process finished with exit code 100

1 Answer

Seth Kroger
Seth Kroger
56,409 Points

The "java.net.BindException: Address already in use" part means either there's a previous instance of Spark web still running or another program is running a server on the same port. You can check for console tabs in IntelliJ and stop/close them and retry. If all else fails you can reboot the computer and try again.

Kentessa Fanfair
Kentessa Fanfair
11,261 Points

Rebooting the computer, as Seth Kroger suggested, worked for me.