在以下过程中发生内部错误:“启动JCuc”。 java.lang.NullPointerException

时间:2020-04-25 16:46:00

标签: java eclipse junit nullpointerexception cucumber

在Eclipse中,当签出Cucumber时,我尝试运行具有以下条目的Junit类:

@RunWith(Cucumber.class)
public class JCuc {

}

附带的Java主类还具有以下条目

public class LoginStep {
@Given("^the url is present$")
public void the_url() throws Throwable {

}

@Given("^the website is loaded$")
public void the_website_is_loaded() throws Throwable {

}

@When("^Enter valid user name$")
public void enter_valid_user_name() throws Throwable {

}

@When("^Enter valid password$")
public void enter_valid_password() throws Throwable {

}

@Then("^I validate signin$")
public void i_validate_signin() throws Throwable {

}
}

使用Junit 4运行时,出现以下错误 Error screenprint

以上在Eclipse Neon上运行良好 但我在Eclipse 2020-03(4.15)中遇到错误 有人可以帮忙吗

1 个答案:

答案 0 :(得分:0)

!ENTRY org.eclipse.core.jobs 4 2 2020-04-27 20:45:51.730
!MESSAGE An internal error occurred during: "Launching JCuc".
!STACK 0
java.lang.NullPointerException
    at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.localURL(JUnitLaunchConfigurationDelegate.java:715)
    at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.entryString(JUnitLaunchConfigurationDelegate.java:704)
    at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.addEntry(JUnitLaunchConfigurationDelegate.java:691)
    at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate$ClasspathLocalizer.localizeClasspath(JUnitLaunchConfigurationDelegate.java:682)
    at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getClasspathAndModulepath(JUnitLaunchConfigurationDelegate.java:631)
    at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getVMRunnerConfiguration(JUnitLaunchConfigurationDelegate.java:196)
    at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launch(JUnitLaunchConfigurationDelegate.java:257)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:860)
    at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:719)
    at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1017)
    at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:1220)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

这是我可以找到的日志条目