代码之家  ›  专栏  ›  技术社区  ›  Ori Marko

Eclipse-无效的类路径容器:项目中的“TestNG”

  •  0
  • Ori Marko  · 技术社区  · 5 年前

    它失败了,所以我回滚到以前的版本,现在我有一个问题

    'Invalid classpath container: 'TestNG' in project 
    

    我不能靠你来解决它

    1. 重新安装TestNG

    我没有找到这个问题的相关答案

    错误日志:

    java.lang.NullPointerException
        at org.eclipse.jem.workbench.utility.JavaModelListener.isInClasspath(JavaModelListener.java:367)
        at org.eclipse.jem.workbench.utility.JavaModelListener.isInClasspath(JavaModelListener.java:412)
        at org.eclipse.jem.workbench.utility.JavaModelListener.isInClasspath(JavaModelListener.java:384)
        at org.eclipse.jem.workbench.utility.JavaModelListener.isInClasspath(JavaModelListener.java:305)
        at org.eclipse.jem.internal.adapters.jdom.JavaReflectionSynchronizer.processJavaElementChanged(JavaReflectionSynchronizer.java:117)
        at org.eclipse.jem.workbench.utility.JavaModelListener.processDelta(JavaModelListener.java:116)
        at org.eclipse.jem.internal.adapters.jdom.JavaReflectionSynchronizer.processDelta(JavaReflectionSynchronizer.java:343)
        at org.eclipse.jem.workbench.utility.JavaModelListener.processChildren(JavaModelListener.java:78)
        at org.eclipse.jem.internal.adapters.jdom.JavaReflectionSynchronizer.processChildren(JavaReflectionSynchronizer.java:336)
        at org.eclipse.jem.workbench.utility.JavaModelListener.processJavaElementChanged(JavaModelListener.java:176)
        at org.eclipse.jem.workbench.utility.JavaModelListener.processDelta(JavaModelListener.java:113)
        at org.eclipse.jem.internal.adapters.jdom.JavaReflectionSynchronizer.processDelta(JavaReflectionSynchronizer.java:343)
        at org.eclipse.jem.workbench.utility.JavaModelListener.elementChanged(JavaModelListener.java:63)
        at org.eclipse.jem.internal.adapters.jdom.JavaReflectionSynchronizer.elementChanged(JavaReflectionSynchronizer.java:265)
        at org.eclipse.jdt.internal.core.DeltaProcessor$3.run(DeltaProcessor.java:1738)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
        at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1726)
        at org.eclipse.jdt.internal.core.DeltaProcessor.firePostChangeDelta(DeltaProcessor.java:1559)
        at org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1535)
        at org.eclipse.jdt.internal.core.DeltaProcessor.notifyAndFire(DeltaProcessor.java:2256)
        at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:2146)
        at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:477)
        at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:300)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
        at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:290)
        at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:153)
        at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:379)
        at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1502)
        at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160)
        at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
    

    编辑1

    java.lang.NullPointerException
            at org.eclipse.jdt.launching.JavaRuntime.processJavaLibraryPathEntries(J
    avaRuntime.java:3037)
            at org.eclipse.jdt.launching.JavaRuntime.processJavaLibraryPathEntries(J
    avaRuntime.java:3049)
            at org.eclipse.jdt.launching.JavaRuntime.gatherJavaLibraryPathEntries(Ja
    vaRuntime.java:3000)
            at org.eclipse.jdt.launching.JavaRuntime.computeJavaLibraryPath(JavaRunt
    ime.java:2958)
            at org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate.get
    JavaLibraryPath(AbstractJavaLaunchConfigurationDelegate.java:1081)
            at org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate.get
    VMArguments(AbstractJavaLaunchConfigurationDelegate.java:598)
            at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.colle
    ctExecutionArguments(JUnitLaunchConfigurationDelegate.java:376)
            at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getVM
    RunnerConfiguration(JUnitLaunchConfigurationDelegate.java:185)
            at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launc
    h(JUnitLaunchConfigurationDelegate.java:255)
            at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConf
    iguration.java:862)
            at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConf
    iguration.java:720)
            at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlu
    gin.java:1029)
            at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:
    1243)
            at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
    java.lang.NullPointerException
            at org.eclipse.jdt.launching.JavaRuntime.processJavaLibraryPathEntries(J
    avaRuntime.java:3037)
            at org.eclipse.jdt.launching.JavaRuntime.processJavaLibraryPathEntries(J
    avaRuntime.java:3049)
            at org.eclipse.jdt.launching.JavaRuntime.gatherJavaLibraryPathEntries(Ja
    vaRuntime.java:3000)
            at org.eclipse.jdt.launching.JavaRuntime.computeJavaLibraryPath(JavaRunt
    ime.java:2958)
            at org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate.get
    JavaLibraryPath(AbstractJavaLaunchConfigurationDelegate.java:1081)
            at org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate.get
    VMArguments(AbstractJavaLaunchConfigurationDelegate.java:598)
            at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.colle
    ctExecutionArguments(JUnitLaunchConfigurationDelegate.java:376)
            at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.getVM
    RunnerConfiguration(JUnitLaunchConfigurationDelegate.java:185)
            at org.eclipse.jdt.junit.launcher.JUnitLaunchConfigurationDelegate.launc
    h(JUnitLaunchConfigurationDelegate.java:255)
            at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConf
    iguration.java:862)
            at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConf
    iguration.java:720)
            at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlu
    gin.java:1029)
            at org.eclipse.debug.internal.ui.DebugUIPlugin$2.run(DebugUIPlugin.java:
    1243)
            at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
    

    编辑2

    Eclipse 4.10

    0 回复  |  直到 5 年前
        1
  •  0
  •   XuQing Tan    5 年前

    最新版本支持Eclipse Photon 2018-12:

    https://github.com/cbeust/testng-eclipse/releases/tag/6.14.3.201902250526

    如果您仍然遇到问题,请在github上加票。

        2
  •  0
  •   Ori Marko    4 年前

    我不得不手动(不使用marketplace)测试来自 http://beust.com/eclipse/