I can't autowire repository in spring

Your issue is about dependencies.

The class, you are looking for is here: https://github.com/spring-projects/spring-data-jpa/blob/master/src/main/java/org/springframework/data/jpa/repository/JpaRepository.java

As you can see, the latest version of spring-data-jpa has it, therefore you should either upgrade your failing delendency to the latest version or downdrade spring-data-jpa version a little bit (not recommended).

I had similar problem in my application with spring boot and mongoDB jpa repositories.

As example, I have spring-data-jpa and spring-data-mongodb dependencies:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency> 
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-mongodb</artifactId>
    <version>1.9.2.RELEASE</version>
</dependency>

But spring boot spring-boot-starter-data-jpa implicitly uses an older version of spring-data-mongodb than 1.9.2.RELEASE. The easiest way to fix was to downgrade spring-data-mongodb to 1.8.4.RELEASE version.