javax.persistence.Entity doesn't exist
Asked Answered
N

1

0

I added the following dependency to Maven:

<dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>persistence-api</artifactId>
            <version>1.0.2</version>
            <scope>provided</scope>
</dependency>

My IDE recognized javax.persistence, but doesn't recognize javax.persistence.Entity.

Do you know why?

Nausea answered 7/5, 2017 at 16:8 Comment(3)
Maybe your IDE (whichever it is) doesnt use Maven? Maybe you dont have something in the CLASSPATH? Maybe you provide inadequate info. Maybe the moon is made of cheese ...Barca
It also fails when I run the code. My IDE is ItelliJ and it uses Maven for sure. I also added a dependency of Spring Boot framework and it succeeded to resolve annotations such as SpringBootApplication, RestController, Autowired, etc.Nausea
Possible duplicate of Spring Boot: does @Entity Annotation exist?Barca
N
3

believe it or not by "mvn install -U" resolved it.

Nausea answered 7/5, 2017 at 19:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.