Hello readers, Today In this article I am going to show you how to Solve – Error: Could not find or load main class cucumber.cli.Main error in Java. So Here I will explain all the possible solutions.
Without wasting your time, Let’s start This Article to Solve This Error.
Table of Contents
How to Error: Could not find or load main class cucumber.cli.Main Occurs?
This is a common error in Java. I am trying to run codes in Intellij into modules, I got the following error. It looks as like below:
Error: Could not find or load main class cucumber.cli.Main
So here I am writing all the possible solutions that I have tried to resolve this error.
How To Solve Error: Could not find or load main class cucumber.cli.Main Error?
- How To Solve Error: Could not find or load main class cucumber.cli.Main Error?
To Solve Error: Could not find or load main class cucumber.cli.Main Error Just need to add this dependency to pom.xml cucumber-java Now, Your error will be solved.
- Error: Could not find or load main class cucumber.cli.Main
To Solve Error: Could not find or load main class cucumber.cli.Main Error Just need to add this dependency to pom.xml cucumber-java Now, Your error will be solved.
Solution 1: add this dependency to pom.xml
Just you have to add this dependency to pom.xml
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>5.7.0</version>
</dependency>
Now, Your error must be solved.
Conclusion
In this article, we have discussed what causes the error and we have discussed ways to fix the error.
we hope this article has been informative. Thank you for reading. Kindly comment and let us know if you found it helpful.