i have updated my cucumber version after that it is giving following exception:
WARNING: You are using deprecated Main class. Please use io.cucumber
I had the same problem.
I put the dependencies below in pom.xml and implements the En interface in the class of steps the problem was solved.
io.cucumber cucumber-java8 4.2.0 test io.cucumber cucumber-spring 4.2.0 test io.cucumber cucumber-junit 4.2.0 test