tolga
tolga

Reputation: 2830

mvn package fails with new SpringBoot project

I just downloaded the default SpringBoot project with default settings from the initilizizer:

Here's my codebase after several test codes:
I had no problem with rest api, thymeleaf but I failed with JPA.

Build fails:

package javax.persistance does not exist
cannot find symbol [ERROR]   symbol: class Entity

It failed just after adding entity annotation, nothing else:

I really like Java. I can't tell you how I want to learn this language...and I believe that I can be successful with the syntax, I can understand the tutorials. This is my only serious problem before moving forward.

My configuration:

Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T21:41:47+03:00)
Maven home: C:\ProgramData\chocolatey\lib\maven\apache-maven-3.6.0\bin\..
Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: C:\Program 
Files\Java\jdk1.8.0_191\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

IDE: Spring Tool Suite 4

Upvotes: 0

Views: 170

Answers (1)

Rmahajan
Rmahajan

Reputation: 1371

Did you import package manually ? It should be as below in your User.java

import javax.persistence.Entity;

Upvotes: 1

Related Questions