Error when running test on IntelliJ IDEA
See original GitHub issueHi,
I have updated Karate Version to last version released (0.5.0) in pom.xml file:
<properties>
<karate.version>0.5.0</karate.version>
</properties>
<dependencies>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-apache</artifactId>
<version>${karate.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.intuit.karate</groupId>
<artifactId>karate-junit4</artifactId>
<version>${karate.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
And with this version:
IntelliJ IDEA 2016.3.5 Build #IC-163.13906.18, built on March 6, 2017 JRE: 1.8.0_112-release-408-b6 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
When I launch a specific feature with Cucumber Plugin (https://plugins.jetbrains.com/plugin/7212-cucumber-for-java), I receive this error:
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/collections/ObservableList
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetPublicMethods(Class.java:2902)
at java.lang.Class.getMethods(Class.java:1615)
at cucumber.runtime.java.MethodScanner.scan(MethodScanner.java:40)
at cucumber.runtime.java.JavaBackend.loadGlue(JavaBackend.java:86)
at cucumber.runtime.Runtime.<init>(Runtime.java:92)
at cucumber.runtime.Runtime.<init>(Runtime.java:70)
at cucumber.runtime.Runtime.<init>(Runtime.java:66)
at cucumber.api.cli.Main.run(Main.java:35)
at cucumber.api.cli.Main.main(Main.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.ClassNotFoundException: javafx.collections.ObservableList
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 16 more
If I launch this with mvn clean test
works fine.
Anyone has suffered this bug?
Thanks for all
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Unable to run JUnit test in IntelliJ - java - Stack Overflow
Open Class in Intellij and press Ctrl+Shift+T · Select "Create New Test" · Now, a new pop up will be opened where you...
Read more >Error when running tests. – IDEs Support (IntelliJ Platform)
I am getting this error when running either a Robot test or unit test. This is for an existing project. I started getting...
Read more >Run tests | IntelliJ IDEA Documentation - JetBrains
To run all tests in a folder, select this folder in the Project tool window and press Ctrl+Shift+F10 or select Run Tests in...
Read more >Right-click on a test class does not show the "run" options
Your project works just fine at my environment - ContextMenuTest is successfully run via context menu action. Please try to execute 'main menu...
Read more >Build error when unit testing only says 'com/intellij/javaee ...
I am using IntelliJ IDEA 2020.2 (Ultimate Edition) and when I try to run a unit test by clicking on the green arrow...
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
@nikhila294 you are using a very old version of karate which is not supported any more. also please ask these kinds of questions on stack overflow
Hi @ptrthomas
Thanks for your response.
I have run it with a Karate-UI and I receive this error:
I have been reading this StackOverFlow thread and I have found that “openjfx” is not installed by default when you install OpenJDK v8. and they recommend two options:
For IntelliJ IDEA users, you have to do this following steps:
You have to make sure that you have this jar files in classpath:
So, now it is working fine. It should be recommended in the extensive documentation to recommend to add this javafx library.
Thanks for your time @ptrthomas