[JVM] getting "Error: Could not find or load main class cucumber.api.cli.Main" when running a single

15,953 views
Skip to first unread message

Kacey Arnold

unread,
Sep 20, 2013, 2:49:21 PM9/20/13
to cu...@googlegroups.com
getting "Error: Could not find or load main class cucumber.api.cli.Main" when running a single feature file in eclipse.
I am trying to run a single feature file I have tried to run it as a cucumber file to no avail, get an "invalid project specified" message.  I followed the instructions from a previous post and listed on the cucumber info site for running a single feature file as a java application. 
MAC OSX
Java 1.7
cucumber-cucumber-jvm-2341737
cucumber-cucumber-jvm-v1.0.14-12-g2341737.zip
cucumber-java-1.1.5-sources.jar
cucumber-java-1.1.5.jar
cucumber-junit-1.1.5-sources.jar
cucumber-junit-1.1.5.jar
Added all the cucumber jars to external jars and I am running it in the dev space which is maven pulling the 1.1.5 jars.  Anyone have any suggestions?  any trouble shooting tips?

Paolo Ambrosio

unread,
Sep 20, 2013, 3:03:14 PM9/20/13
to cu...@googlegroups.com
On Fri, Sep 20, 2013 at 7:49 PM, Kacey Arnold <kcar...@gmail.com> wrote:

> getting "Error: Could not find or load main class cucumber.api.cli.Main"
> when running a single feature file in eclipse.
> I am trying to run a single feature file I have tried to run it as a
> cucumber file to no avail, get an "invalid project specified" message. I
> followed the instructions from a previous post and listed on the cucumber
> info site for running a single feature file as a java application.
> MAC OSX
> Java 1.7
> cucumber-cucumber-jvm-2341737
> cucumber-cucumber-jvm-v1.0.14-12-g2341737.zip
> cucumber-java-1.1.5-sources.jar
> cucumber-java-1.1.5.jar
> cucumber-junit-1.1.5-sources.jar
> cucumber-junit-1.1.5.jar

I cannot understand exactly what your list is (mix of directories,
zip, sources and jars), but cucumber.api.cli.Main is in
cucumber-core-1.1.5.jar

> Added all the cucumber jars to external jars and I am running it in the dev
> space which is maven pulling the 1.1.5 jars. Anyone have any suggestions?
> any trouble shooting tips?

Maven would have downloaded cucumber-core for you, as it is a
dependency of cucumber-java. If you don't want headaches, try and use
Maven dependencies from within Eclipse: it should be well-integrated
in any recent release.


Paolo

Marty Bradley

unread,
Sep 20, 2013, 7:44:21 PM9/20/13
to cu...@googlegroups.com
Casey,

I have a step by step video showing how to set up cucumber-JVM with maven in eclipse ttp://youtu.be/aPDMDufkBSc   i was using 1.1.2 in the video but just change to select the most recent version and you should be fine.

Marty



--
-- Rules --

1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.

You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Marty Bradley
Enterprise Agile Coach
(703) 869-2217
http://www.linkedin.com/in/martybradley
Click to scan contact information

Kacey Arnold

unread,
Sep 23, 2013, 3:06:21 PM9/23/13
to cu...@googlegroups.com
Thank you Marty.
The multiple/all files as a maven option works, it is running just one test/feature file that I can't get to work.

Marty Bradley

unread,
Sep 23, 2013, 3:43:52 PM9/23/13
to cu...@googlegroups.com
How are you trying to run just one feature file? Can you provide more details and any errors you are seeing?

Kacey Arnold

unread,
Sep 24, 2013, 12:58:15 PM9/24/13
to cu...@googlegroups.com
I was using the instructions provided by the gentleman who wrote the automation framework.  After talking with a co-worker I am now going to use a runner file as you and he suggested.
but for your information here are the instructions provided to run a single feature file

Run a single feature

  1. open the feature file
  2. right click to bring up context menu.
  3. select Run As/Cucumber Test.

This will execute all scenarios in this feature file. Note that this option is provided by the Cucumber plug-in, so it won't be available unless this plug-in is installed.

Marty Bradley

unread,
Sep 24, 2013, 5:06:16 PM9/24/13
to cu...@googlegroups.com
ah got it.  Thanks. 
Reply all
Reply to author
Forward
0 new messages