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! While you're at it, check out some resources Treehouse students have shared here.

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 Intro to Java Web Development with Spark Diving into Web Development Meet Spark

Sandeep Annapareddy
Sandeep Annapareddy
3,141 Points

Error running the project

Hi, when I tried to run the project, I have been getting the following errors:

"C:\Program Files\Java\jdk1.8.0_65\bin\java" "-javaagent:C:\Program SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

Please let me know how I can fix them. Thanks

Yanuar Prakoso
Yanuar Prakoso
15,196 Points

what version of Spark do you use?

5 Answers

Yanuar Prakoso
Yanuar Prakoso
15,196 Points

please try to change it to version 2.3 (the same version as Craig)

compile "com.sparkjava:spark-core:2.3"

then restart all processes

Kareem Jeiroudi
Kareem Jeiroudi
14,984 Points

I was getting the same message. There are two possibilities: either import the same version that Craig used,

compile 'com.sparkjava:spark-core:2.3'

or look up this StackOverflow post

Fathima Fas-ha
Fathima Fas-ha
6,847 Points

I also had the same error, I had imported in the Main class

java
import static spark.route.HttpMethod.get;

instead of

java
import static spark.Spark.get;

check whether you have imported the correct one!! :)

Alec Meyer
Alec Meyer
6,303 Points
compile 'org.slf4j.slf4j-simple:1.7.21'

Add that to your build.gradle

Tonnie Fanadez
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Tonnie Fanadez
UX Design Techdegree Graduate 22,796 Points

If you're here in Oct. 2019 these 3 lines of code might save you.

    compile 'com.sparkjava:spark-core:2.9.1'
    compile 'org.slf4j:slf4j-api:2.0.0-alpha1'
    compile 'org.slf4j:slf4j-simple:2.0.0-alpha1'

Cheers