我有一个SpringBoot应用程序在java8上运行得很好。我刚刚被告知,我们将部署的服务器应用程序只能运行Java7或更低版本。这仍然是一个小的应用程序,但我只是想改变
build.gradle
让它工作。我被错误缠住了:
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/springframework/boot/SpringApplication : Unsupported major.minor version 52.0
这是我的
:
buildscript {
ext {
springBootVersion = '1.5.16.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'com.menighin'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
mavenCentral()
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
compile('org.springframework.boot:spring-boot-starter-data-rest')
// compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.session:spring-session-core')
runtime('org.springframework.boot:spring-boot-devtools')
compileOnly('org.projectlombok:lombok')
testCompile('org.springframework.boot:spring-boot-starter-test')
// testCompile('org.springframework.security:spring-security-test')
}
我刚把枪放下
springBootVersion
sourceCompatibility
和
targetCompatibility
1.7
. 你知道我还需要改什么版本吗?
SpringBoot documentation on 1.5.16