Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Intro to Java Web Development with Spark Diving into Web Development Meet Spark

Ivailo Hristov
Ivailo Hristov
6,297 Points

SLF4J and Lambda Expressions not supported

First problem is

"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. "
I import different SLF4J tasks like slf4j-nop.jar slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar i download them from maven repository and add by gradle and nothing...

also I have problems with java 8 it says "lambda expressions are not supported at this language level" i try all

File > Project Structure > Project > Project SDK: Change it to Java 1.8.XX
File > Project Structure > Project > Language Level: SDK 8 (in my case SDK default was already 8)
File > Project Structure > Modules > Sources > SDK 8 (in my case SDK default was already 8)
File > Settings > Build, Execution, Deployment > Compiler > Java Compiler > Project bytecode version > 1.8
File > Settings > Build, Execution, Deployment > Compiler > Java Compiler > Per-module bytecode version > Target bytecode version > 1.8

but not work Thnks!

3 Answers

Seth Kroger
Seth Kroger
56,403 Points

In build.gradle, if there is a line sourceCompatibility = 1.something or targetCompatibility = 1.something make sure it equals 1.8. If they aren't present then open Project Structure (Under the File menu or an icon with small blue squares near the right end of the toolbar.) Click Project on the left make sure the SDK and Project language level are 8.

Ivailo Hristov
Ivailo Hristov
6,297 Points

Thank you for the responce, my sourceCompatibility was 1.5

Jose Mejia
Jose Mejia
16,750 Points

I have the same problem. "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. " I have set to 1.8 and i am using compile 'com.sparkjava:spark-core:2.7.1'

any ideas or help thanks

Michael Chan
Michael Chan
1,472 Points

I'm still having the issue despite. Can someone help? I am using Spark 2.7.1 and my source compativility is 1.8.

I have the same problem, can someone help? Spark edition: 2.9.1 target compatibility:1.8