Exception in thread "main" java.lang.Error: Unresolved compilation problems after running my first Appium script

Exception in thread “main” java.lang.Error: Unresolved compilation problems after running my first Appium script. Can somebody help me to come out from this issue?

Note: I imported all required packages as below.

import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.android.AndroidDriver;

Please find more error details below.

Exception in thread “main” java.lang.Error: Unresolved compilation problems:
DesiredCapabilities cannot be resolved to a type
DesiredCapabilities cannot be resolved to a type
AppiumDriver cannot be resolved to a type
MobileElement cannot be resolved to a type
AndroidDriver cannot be resolved to a type
MobileElement cannot be resolved to a type

Hi ,am also facing same issue,can anybody suggest to me,what is the reason for this error,how to get resolve?

Description Resource Path Location Type
The import org.openqa.selenium.remote.DesiredCapabilities cannot be resolved sample1.java /first/src/first line 7 Java Problem