Reputation: 21
package org.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.*;
/**
* Spring boot main Application
*
*/
@SpringBootApplication
public class Application
{
public static void main( String[] args ) throws Exception
{
SpringApplication.run(Application.class, args);
}
}
Upvotes: 0
Views: 12434
Reputation: 1
When I set the sourceCompatibility to the correct version in build.gradle, it fixed my error.
Also, gradle version should be compatible to the Java version.
Upvotes: 0
Reputation: 89
This may be due to "spring-boot-starter-parent" version issue.
i have changed the version it resolved the errors.
Upvotes: -1
Reputation: 21
If you are doing it with gradle. Make sure you have "org.springframework.boot:spring-boot-gradle-plugin:1.5.6.RELEASE"
at classpath and apply plugin :'org.springframework.boot'
included in your bulid.gradle file.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.6.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
Upvotes: 2
Reputation: 654
I faced the same issue and manage to solve it by
deleting all maven local repo and update it back using maven -> update project
Upvotes: 0
Reputation: 11
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
</parent>
add above dependency
Upvotes: 1