NoClassDefFoundError:gherkin/IGherkinDialectProvider was observed while running a cucumber program can anyone help me to understand reason of this error and how to resolve this. refer screenshot. Thank you.enter image description here
Asked
Active
Viewed 808 times
1
-
2Please include your pom or gradle file. If you aren't using either, please ensure all dependencies are on the class path. – M.P. Korstanje Aug 30 '18 at 12:51
-
Did you google this error and investigate the results? I'm seeing a lot of results referring to mismatched versions between cucumber and gherkin. Also, don't post screenshots of error message (or text in general). Instead copy and paste the error message and edit it into your question. – JeffC Aug 30 '18 at 13:21
-
Probably the `scope` of dependency `io.cucumber:gherkin` is not defined as `test`. – SubOptimal Aug 30 '18 at 14:45
-
@mpkorstanje I have added all the jars to my project, its a simple project created in eclipse im not using maven for now. Below is the stack trace of the error--------- java.lang.NoClassDefFoundError: gherkin/deps/com/google/gson/Gson at gherkin.GherkinDialectProvider.
(GherkinDialectProvider.java:17) at cucumber.runtime.UndefinedStepsTracker. – SuperShazam Aug 31 '18 at 12:34(UndefinedStepsTracker.java:28) at cucumber.runtime.Runtime. (Runtime.java:30) -
@JeffC Hello Jeff Im quite new over here as well as in Cucumber. As you said I have googled the issue and in some cases ppl say it happens because of version mismatch but there is no mention of *which versions are compatible.* I have tried with two versions of gherkin 2.12.2 and 3.2.0 and have received the same errors for both. Its my first program and I am quite stuck in that any help will be appreciated. Thank you. – SuperShazam Aug 31 '18 at 12:41
-
See [this](https://github.com/reportportal/agent-java-cucumber/issues/9) and [this](https://stackoverflow.com/questions/36771066/java-lang-noclassdeffounderror-exception-while-running-cucumber-test-using-junit) – JeffC Aug 31 '18 at 13:07
-
1@SuperShazam the question is which versions are compatible can be solved by using maven or gradle. Please note that the groupId has changed from `cucumber` to `io.cucumber` – M.P. Korstanje Aug 31 '18 at 13:33
-
@JeffC Most often when people say "compatible versions" in relation to Cucumber, they mean using the same Cucumber version for each Cucumber dependency. Also, I'd highly recommend using Maven or Gradle for dependency management, so you don't have to find all the compatible jars yourself. Check docs.cucumber.io for how to install (which dependencies are needed). – Marit Oct 11 '18 at 10:37