Solved - Cannot find javax.validation Problem

Last Updated on: January 19, 2021 pm

[Solved]Cannot find javax.validation problem

Problem

Having copied and pasted Hibernate Validation jar files into WEB-INF/lib, still cannot find @NotNull and @Size annotations, and cannot resovle these jar files.

1
2
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

Solution

  1. File -> Project Structure -> Module -> “+” -> Hibernate

  1. Fix -> Download -> OK -> Apply -> OK

Note: Don’t forget to change the download path to WEB-INF/lib

  1. Copy and paste the required JAR files provided by the instructor to path WEB-INF/lib
  2. Add these JAR Files to the Hibernate library.

Library -> Hibernate -> “+” -> select the JAR files in WEB-INF/lib -> Apply -> OK

Result

Reference: Udemy, Spring & Hibernate for Beginners (including SpringBoot)