I cannot reproduce. After adding JAR file to dependencies and adding an import statement on top of the class file everything worked as expected. Maybe try to change scope?

Dependencies:

Class file:

Answer from Renats Stozkovs on Stack Overflow
🌐
Apache Commons
commons.apache.org › cli › download_cli.cgi
Download Apache Commons CLI – Apache Commons CLI
November 8, 2025 - Apache Commons, Apache Commons CLI, Apache, the Apache logo, and the Apache Commons project logos are trademarks of The Apache Software Foundation.
🌐
Maven Repository
mvnrepository.com › artifact › commons-cli › commons-cli
Maven Repository: commons-cli » commons-cli
November 13, 2025 - Apache Commons CLI provides a simple API for presenting, processing, and validating a Command Line Interface.
🌐
Jar-Download
jar-download.com › home › commons-cli › commons-cli
Download commons-cli JAR files with all dependencies
March 9, 2017 - Download commons-cli JAR files ✓ With dependencies ✓ Documentation ✓ Source code
🌐
Jar-download
jar-download.com
Download commons-cli-1.2 JAR files with all dependencies
Download JAR files for commons-cli-1.2 ✓ With dependencies ✓ Documentation ✓ Source code
🌐
GitHub
github.com › apache › commons-cli
GitHub - apache/commons-cli: Apache Commons CLI · GitHub
Apache Commons CLI provides a simple API for presenting, processing, and validating a Command Line Interface.
Starred by 389 users
Forked by 249 users
Languages   Java 97.4% | JavaScript 2.4%
🌐
Opensource.com
opensource.com › article › 21 › 8 › java-commons-cli
Parse command options in Java with commons-cli | Opensource.com
August 13, 2021 - The only required JAR is the commons-cli-X.Y.jar (where X and Y are the latest version numbers.) Add that JAR to your project, either manually or in your IDE, and then you can use it in your code.
🌐
Apache Commons
commons.apache.org › cli
Apache Commons CLI – Apache Commons CLI
November 8, 2025 - Apache Commons, Apache Commons CLI, Apache, the Apache logo, and the Apache Commons project logos are trademarks of The Apache Software Foundation.
Find elsewhere
🌐
Maven Repository
mvnrepository.com › artifact › commons-cli › commons-cli › 1.2
Maven Repository: commons-cli » commons-cli » 1.2
Apache Commons CLI provides a simple API for presenting, processing, and validating a Command Line Interface.
🌐
TutorialsPoint
tutorialspoint.com › commons_cli › commons_cli_quick_guide.htm
Apache Commons CLI - Quick Guide
Download the latest version of Apache Common IO jar file from commons-cli-1.10.0-bin.zip.
🌐
Findjar
findjar.com › jar › commons-cli › commons-cli › 1.2 › commons-cli-1.2.jar.html
commons-cli-1.2.jar - JAR Search - findJAR.com
March 19, 2009 - This page shows details for the JAR file commons-cli-1.2.jar contained in commons-cli/commons-cli/1.2. Apart from vendor, name and version also the contained classes and JAR dependencies are listed.
🌐
Jar-Download
jar-download.com › home › commons-cli › commons-cli › 1.3.1 › source code
Download commons-cli JAR 1.3.1 ➔ With all dependencies!
Apache Commons CLI provides a simple API for presenting, processing and validating a command line interface. ✓ Download JAR commons-cli 1.3.1 ✓ With dependencies ✓ Source of commons-cli ☄ One click! ☄
🌐
Apache
wiki.apache.org › commons › CLI
CLI - Apache Commons - Apache Software Foundation
This wiki site is used for discussion of topics associated with the commons-cli project whose home page is http://commons.apache.org/cli · CLI Release 2.0 is currently only available via snapshot from SVN. However here is a sample application to wet your appetites. ../CLI2/SampleApplication · CLI2 has been moved to the sandbox and becomes a separate project. Contributions are welcome! Release 1.0 occurred in Nov 2002. Due to an unfortunate accident, the 1.0 jar file published on ibiblio at http://www.ibiblio.org/maven/commons-cli/jars was overwritten at some point by a snapshot of later code, i.e.
🌐
Maven Central
repo1.maven.org › maven2 › commons-cli › commons-cli › 1.4
Central Repository: commons-cli/commons-cli/1.4
../ commons-cli-1.4-javadoc.jar 2017-03-09 13:02 179154 commons-cli-1.4-javadoc.jar.asc 2017-03-09 13:02 801 commons-cli-1.4-javadoc.jar.md5 2017-03-09 13:02 32 commons-cli-1.4-javadoc.jar.sha1 2017-03-09 13:02 40 commons-cli-1.4-sources.jar 2017-03-09 13:02 63104 commons-cli-1.4-sources.jar.asc 2017-03-09 13:02 801 commons-cli-1.4-sources.jar.md5 2017-03-09 13:02 32 commons-cli-1.4-sources.jar.sha1 2017-03-09 13:02 40 commons-cli-1.4-test-sources.jar 2017-03-09 13:02 57339 commons-cli-1.4-test-sources.jar.asc 2017-03-09 13:02 801 commons-cli-1.4-test-sources.jar.md5 2017-03-09 13:02 32 common
🌐
Fyicenter
jar.fyicenter.com › 3139_commons-cli-1.4-sources.jar-Apache_Commons_CLI.html
Apache Commons CLI Source Code Files
Apache Commons CLI Source Code Files are provided in the source package file commons-cli-1.5.0-sources.jar. You can downlo
🌐
Maven Central
repo1.maven.org › maven2 › commons-cli › commons-cli › 1.5.0
Central Repository: commons-cli/commons-cli/1.5.0
../ commons-cli-1.5.0-javadoc.jar 2021-10-23 21:48 185927 commons-cli-1.5.0-javadoc.jar.asc 2021-10-23 21:48 833 commons-cli-1.5.0-javadoc.jar.md5 2021-10-23 21:48 32 commons-cli-1.5.0-javadoc.jar.sha1 2021-10-23 21:48 40 commons-cli-1.5.0-sources.jar 2021-10-23 21:48 63124 commons-cli-1.5...