Eclipse error cannot be resolved to a type
NickName:Liza Ask DateTime:2018-11-08T02:08:57

Eclipse error cannot be resolved to a type

I am trying to learn Cucumber using Maven + Eclipse. When trying to import the following I am getting the error respectively

import cucumber.org.junit.runner.RunWith;
import cucumber.api.junit.CucumberOptions;

CucumberOptions cannot be resolved to a type
RunWith cannot be resolved to a type

I have search through and read possible ways to resolved this but nothing worked for me.

POM Details:

<dependency>
    <groupId>io.cucumber</groupId>
    <artifactId>cucumber-junit</artifactId>
    <version>4.2.0</version>
    <scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
<dependency>
    <groupId>io.cucumber</groupId>
    <artifactId>cucumber-java</artifactId>
    <version>4.2.0</version>
</dependency>

Version of Java/Exclipse/Maven
Eclipse IDE for Java Developers - Version: 2018-09 (4.9.0)
JAVA 11.0.1
Maven 3.6.0 

Not sure what I am doing wrong if someone could help please.

Copyright Notice:Content Author:「Liza」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/53195300/eclipse-error-cannot-be-resolved-to-a-type

More about “Eclipse error cannot be resolved to a type” related questions

Eclipse error: cannot be resolved to a type

With a friend's help, I made a simple app for school that loads a webpage like an iframe into it. Next, I need to learn how to add a share button so it's users can tell their friends about my app. I

Show Detail

Eclipse error cannot be resolved to a type

I am trying to learn Cucumber using Maven + Eclipse. When trying to import the following I am getting the error respectively import cucumber.org.junit.runner.RunWith; import cucumber.api.junit.

Show Detail

Eclipse error - Cannot be resolved to type

Created a Maven Project and have set the dependencies in the pom.xml. The import statement (com.splunk.*) seems to recognize the library included in the Maven Dependencies, however when I refer to ...

Show Detail

MQTT cannot be resolved in Eclipse IDE

I am learning about MQTT protocol and I run this code I found on Google: import org.eclipse.paho.client.mqttv3.MqttClient; import org.eclipse.paho.client.mqttv3.MqttConnectOptions; import org.ecli...

Show Detail

eclipse - type cannot be resolved

I am following the tutorial from the book "Android Programming Tutorials, 3rd Edition". In lesson number 3 "A Fancier Form" I experience some problems within Eclipse. The author says to add the

Show Detail

How to overcome the error: cannot be resolved to a type

I tired to run the following java codes via eclipse but I get the errors. So, what should I do? I am a beginer. I tried the second answer of the page but it did not work for me. Eclipse error ... ...

Show Detail

Eclipse - Cannot be resolved to a type

Looking at other questions that are similar, the error i am receiving is sometimes due to an Eclipse bug. However, since i am a novice, this may not be the case. The error: Values cannot be re...

Show Detail

Eclipse message saying List cannot be resolved to a type

I am trying the following code in eclipse: public class A { List&lt;Integer&gt; intList = new ArrayList&lt;Integer&gt;(); } However it gives me an error saying: List cannot be resolved to a

Show Detail

Eclipse OnErrorListener cannot be resolved as a type

Something strange is happening. I want to put an ErrorListener on a VideoView. I had already did this with another project, but today I have this bug with Eclipse that doesn't enable me do this... I

Show Detail

Eclipse (Android): Cannot be resolved to a type/variable etc

Hey guys after updating Eclipse (Help -&gt; Check for Updates) and Android-SDK-Manager I always get the "…cannot be resolved to a type" or "…cannot be resolved to a variable" message. I get this Er...

Show Detail