Requirements
Before installing Validator, ensure your environment meets these requirements:- Java Development Kit (JDK) 11 or higher
- Maven 3.x or Gradle 6.x+ (if using dependency management)
Validator has zero external dependencies (except for testing). It’s a lightweight library that won’t bloat your application.
Installation Methods
- Maven
- Gradle
- JAR Download
Add the following dependency to your Then run:
pom.xml file:pom.xml
Full pom.xml example
Full pom.xml example
pom.xml
Verify Installation
Create a simple test class to verify Validator is properly installed:Compile and Run
- Maven
- Gradle
- Command Line
Is 'Hello' valid? true, installation was successful!
Troubleshooting
ClassNotFoundException: Validator not found
ClassNotFoundException: Validator not found
Cause: The Validator library is not on the classpath.Solution:
- Maven: Run
mvn clean installto download dependencies - Gradle: Run
gradle build --refresh-dependencies - JAR: Verify the JAR file path in your classpath configuration
UnsupportedClassVersionError
UnsupportedClassVersionError
Cause: You’re using Java 10 or lower. Validator requires Java 11+.Solution: Upgrade to Java 11 or higher:Update your
pom.xml or build.gradle:Dependency resolution failed
Dependency resolution failed
Cause: Maven Central repository is not configured or network issues.Solution:
- Verify internet connection
- Check repository configuration in
settings.xml(Maven) orbuild.gradle(Gradle) - Try clearing cache:
mvn cleanorgradle clean
Cannot resolve symbol 'Validator'
Cannot resolve symbol 'Validator'
Cause: IDE hasn’t indexed the new dependency.Solution:
- IntelliJ IDEA: File → Invalidate Caches / Restart
- Eclipse: Project → Clean
- VS Code: Reload window (Ctrl+Shift+P → “Reload Window”)
Version Information
Current Version: 1.3.2Release Notes:
- The
validOrFailandcompareOrFailmethods now require akeyparameter - Fixed
instanceofcheck forInvalidEvaluationException - Updated message for
namerule and@Nameannotation
Checking for Updates
Visit the Maven Central Repository to check for the latest version.IDE Integration
IntelliJ IDEA
Auto-import works out of the box with Maven/Gradle projects
Eclipse
Use m2e (Maven) or Buildship (Gradle) plugins
VS Code
Install the Java Extension Pack for dependency management
Next Steps
Now that Validator is installed, you’re ready to start validating strings!Quick Start Guide
Learn how to create your first validator and start validating strings in minutes