I have been trying to run a simple cucumber test. But it gives me the following errors:
Exception in thread "main" java.lang.NoClassDefFoundError: cucumber/io/ResourceLoader
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at cucumber.runtime.Reflections.hasConstructor(Reflections.java:51)
at cucumber.runtime.Reflections.instantiateSubclasses(Reflections.java:28)
at cucumber.runtime.Runtime.loadBackends(Runtime.java:96)
at cucumber.runtime.Runtime.<init>(Runtime.java:63)
at cucumber.api.cli.Main.run(Main.java:24)
at cucumber.api.cli.Main.main(Main.java:16)
Caused by: java.lang.ClassNotFoundException: cucumber.io.ResourceLoader
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 10 more
My test looks like this. I think a jar file is missing. Not familiar with cucumber setup
Feature: AddUser
In order to perform operations on the library system
I want to be able to add a valid user.
Scenario: Add unique user
Given I have entered a username Ali
And I have entered a password 22
And I have entered a given name ali
And I have entered a family name abbas
And I have entered a middle Initial F
And I have entered a email ali@gmail.com
And I have entered a roleID Member
When I press Create User
Then a new user should be added