Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

org.springframework.boot.autoconfigure cannot be resolved in eclipse

I imported the spring-boot-1.1.10.RELEASE.jar into my j2ee project. But i can not found the class of autoconfigure. Here is code:

import org.springframework.boot.autoconfigure;
import org.springframework.boot.SpringApplication;
import org.springframework.context.annotation.ComponentScan;
@ComponentScan
@EnableAutoConfiguration
public class Application {
    public static void main(String[] args) {
      SpringApplication.run(Application.class, args);
     }
 }

The Compile error:

The import org.springframework.boot.autoconfigure cannot be resolved

like image 810
dalei19 Avatar asked Jan 07 '15 14:01

dalei19


1 Answers

I had the same problem and I tried above solutions. But I have found a different issue.

In latest springframework, this org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder has been moved to org.springframework.boot.jdbc.DataSourceBuilder. so you have to edit in import

And then you will notice that you have to use DataSourceBuilder.create(classLoader) instead of new DataSourceBuilder(classLoader)

like image 183
Uzzal Podder Avatar answered Sep 28 '22 06:09

Uzzal Podder