question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cucumber-java8 does not work on OpenJDK 12+

See original GitHub issue

When using OpenJDK 12+ in combination with cucumber-java8 users may experience class cast exceptions. See: Java+Cucumber execution error (java.lang.ClassCastException: class io.cucumber.docstring.DocString cannot be cast to class java.lang.String)

These occur because typetools is unable to read the parameter types from lambdas on OpenJDK 12+. See https://github.com/jhalterman/typetools/issues/52,

cucumber-java should not be affected. They’re separate modules since v4.0.0.

Resolving this requires fixing https://github.com/jhalterman/typetools/issues/52 to make TypeTools to work on Java 12+.

Update

The Cucumber team does not have resources available to fix this. We will deprecate cucumber-java8 at some point in the future.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bestbeforetodaycommented, May 15, 2020

The fix in PR #1902 seems to have broken Cucumber tests that were previously running fine in OpenJDK 11.0.4, despite the failure message saying:

This version of cucumber-java8 is not compatible with Java 12+ See: https://github.com/cucumber/cucumber-jvm/issues/1817

The line that was previously working in Java 11 and is now failing is:

Given("I have deployed a {word} Fabric network", (String tlsType) -> {

I see this problem with cucumber-java8 version 5.7.0.

0reactions
mpkorstanjecommented, Jun 28, 2022

Good point. Could you create an issue in https://github.com/cucumber/docs and reference:

https://github.com/cucumber/cucumber-jvm/issues/2279

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cucumber - Java8 - using @Before with lambda expressions
If I put them in a method, as shown here, when I run the feature file it runs the @Before statement but does...
Read more >
Developers - Deprecate and remove cucumber-java8 - - Bountysource
cucumber-java8 does not work on OpenJDK 12+. The Cucumber team does not have the time and people available to make cucumber-java8 work on...
Read more >
When steps are defined using io.cucumber.java.en.Given intllij ...
Given intllij does not recognize it in the feature file. Only when the deprecated cucumber.api.java.en.Given is used is the step identified as implemented....
Read more >
Not all OpenJDK 12 builds include Shenandoah: Here's why
i want to install open jdk 8 with shenondoah on RHEL 7 , can i do that? AndrewHaley • 2 years ago. Sure,...
Read more >
Cucumber Java 8 Support - Baeldung
The cucumber-java8 dependency can be found on Maven Central. ... As we are using one statement we didn't need curly braces ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found