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?

CrazySynthax
  • 13,662
  • 34
  • 99
  • 183
  • 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 ... – Neil Stockton May 07 '17 at 16:15
  • 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. – CrazySynthax May 07 '17 at 16:19
  • Possible duplicate of [Spring Boot: does @Entity Annotation exist?](http://stackoverflow.com/questions/43832705/spring-boot-does-entity-annotation-exist) – Neil Stockton May 07 '17 at 17:07

1 Answers1

3

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

CrazySynthax
  • 13,662
  • 34
  • 99
  • 183