newcoder1010 Posted September 18, 2022 Share Posted September 18, 2022 (edited) Hello, Maven dependency: <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.4.0</version> </dependency> Main method public class HelloMain { private final static Logger log = LoggerFactory.getLogger(HelloMain.class); public static void main(String[] args) { log.info("hello"); } } When I run the program in IntelliJ, I get the error on the following line: private final static Logger log = LoggerFactory.getLogger(HelloMain.class); Quote ch/qos/logback/classic/spi/LogbackServiceProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 I fixed it by changing the dependency version: <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>1.3.0</version> </dependency> Java on my pc: C:\Users\sa>java -version java version "1.8.0_341" Java(TM) SE Runtime Environment (build 1.8.0_341-b10) Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode) Could you please explain me why I got the error first place? Why changing the version of logback fixed the problem? I am bit confused with java compiler, JDK, JRE, and Dependency version. If you could include an example, it would help. I am new to Spring framework. Thank you! Edited September 18, 2022 by newcoder1010 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now