3

I have created a new project in IntelliJ with help of Spring initializer and selected JDK version 1.7 and spring boot 2.0.1. I have created a main class and try to run the application but getting the error "Exception in thread "main" java.lang.UnsupportedClassVersionError: org/springframework/web/client/RestTemplate : Unsupported major.minor version 52.0". I have tried a lot of solutions but unluckily unable to fix the problem. Can anyone please help me to sort out the issue.

Thanks

Touqeer
  • 87
  • 2
  • 12

2 Answers2

2

It's because Java version mismatch.

Spring boot 2.0.1 requires JDK 8 and above.

So you should install and specify JDK 8 for your application

More information here.

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Release-Notes#java-8-baseline-and-java-9-support

Mạnh Quyết Nguyễn
  • 17,677
  • 1
  • 23
  • 51
0

The version of the spring boot 2.0.1 is compiled for JDK1.8

Azzabi Haythem
  • 2,318
  • 7
  • 26
  • 32