cucumber-java8 fails on OpenJDK 1.8.0
See original GitHub issueCucumber-Java8 depends on internals of the implementation of Oracle’s JDK8. When I started experimenting with it I just always got the following exception:
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.056 sec <<< FAILURE! - in soy.wimmer.CucumberIT
Feature: Cucumber with Java8 Time elapsed: 0.047 sec <<< ERROR!
cucumber.runtime.CucumberException: Failed to instantiate class soy.wimmer.CucumberStepdefs
[…]
Caused by: java.lang.reflect.InvocationTargetException: null
[…]
Caused by: cucumber.runtime.CucumberException: java.lang.IllegalArgumentException: Wrong type at constant pool index
[…]
Caused by: java.lang.IllegalArgumentException: Wrong type at constant pool index
at sun.reflect.ConstantPool.getMemberRefInfoAt0(Native Method)
at sun.reflect.ConstantPool.getMemberRefInfoAt(ConstantPool.java:47)
at cucumber.runtime.java8.ConstantPoolTypeIntrospector.getTypeString(ConstantPoolTypeIntrospector.java:37)
at cucumber.runtime.java8.ConstantPoolTypeIntrospector.getGenericTypes(ConstantPoolTypeIntrospector.java:27)
at cucumber.runtime.java.Java8StepDefinition.<init>(Java8StepDefinition.java:45)
at cucumber.runtime.java.JavaBackend.addStepDefinition(JavaBackend.java:162)
at cucumber.api.java8.En.Given(En.java:190)
at soy.wimmer.CucumberStepdefs.<init>(CucumberStepdefs.java:8)
[…]
The test project causing this output is available at https://github.com/mawis/cucumber-java8-test
While it fails on OpenJDK8 it works without problems on Oracle JDK8. I consider this to be a bug, as I don’t think that cucumber should depend on a specific implementation of the compiler.
Issue Analytics
- State:
- Created 8 years ago
- Comments:63 (32 by maintainers)
Top Results From Across the Web
Exception in thread "main" cucumber.runtime ...
This error is thrown when no 'backends' are found on the classpath. There is a 'backend' for each supported language (e.g. cucumber-java, ...
Read more >[CUCUMBER-JVM] Not Instantiating Step Definitions
I'm going through the CucumberJVM book but using Java 8 instead and I'm ... CucumberException: Failed to instantiate class step_definitions.
Read more >UnsupportedClassVersionError when running cucumber tests ...
When I try to run my Cucumber run configurations I get the error below. It seems CucumberJvm4SMFormatter is now compiled with Java 11...
Read more >cucumber-jvm : 6.8.0 - Maven Central Repository Search
... </dependency> <dependency> <groupId>io.cucumber</groupId> <artifactId>cucumber-java8</artifactId> <version>${project.version}</version> </dependency> ...
Read more >Cucumber-JVM
Make sure the Cucumber version is the same for all Cucumber dependencies. Maven. Add the following dependency to your pom.xml : <dependency> <groupId>io....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Grief Hopefully a 1.2.5-version will not have to wait to far into the future, but #1034 is better fixed before that. Until then the latest build on the master is available as a snapshot release.
Upgrade. Check the version badge in the readme.