user851380
user851380

Reputation: 339

Spring javax.validation problem

In my application with spring framework, I have this import which it couldn't find

 import javax.validation.Valid;

Thing is I already have that javax.jar in the classpath. So my question is is there a different version of javax.jar that has validation package or I need any other jar files? I couldn't find any javax.jar that has validation package on the internet. So please give me a link if you know any. Thanks in advance!

Upvotes: 1

Views: 4037

Answers (3)

André Ferraz
André Ferraz

Reputation: 13

If you are using maven, just add the external dependency in your pom.xml

<dependency>
    <groupId>javax.validation</groupId>
    <artifactId>validation-api</artifactId>
    <version>2.0.1.Final</version>
</dependency>

Verify the latest version here: https://mvnrepository.com/artifact/javax.validation/validation-api

Upvotes: 0

Ryan Stewart
Ryan Stewart

Reputation: 128949

You're looking for javax.validation:validation-api.

Also, as Amir mentioned, if you've found stackoverflow useful, accept some answers. People will be more inclined to help out.

Upvotes: 1

Amir Raminfar
Amir Raminfar

Reputation: 34179

javax.validation.* is part of jsr-303 which needs to be downloaded separately here.

Upvotes: 0

Related Questions