You can run the test the same way you would run a JUnit test on the command line:
java -cp <classpath> org.junit.runner.JUnitCore com.example.test.RunCukesTest
where RunCukesTest is the unit test that sets all the cucumber options, e.g.:
package com.example.test;
import org.junit.runner.RunWith;
import cucumber.api.junit.Cucumber;
import cucumber.api.CucumberOptions;
@RunWith(Cucumber.class)
@CucumberOptions(plugin = "json:target/report.json")
public class RunCukesTest {
}
<classpath> is where you can mention your JAR files.
If all your JAR files are inside lib folder, your command can be:
java -cp "lib/*" org.junit.runner.JUnitCore com.example.test.RunCukesTest