JUNIT Test class in Eclipse - java.lang.ClassNotFoundException

后端 未结 26 1934
栀梦
栀梦 2020-12-14 13:55

I\'m trying to run my junit test (to verify that a properties file loads correctly) but I get ClassNotFoundException although the class is there and all requir

26条回答
  •  自闭症患者
    2020-12-14 14:39

    A variation on Guy's answer above, involving additional builders. Say you have an Ant builder configured:

    
        
            org.eclipse.jdt.core.javabuilder
            
            
        
        
            org.eclipse.ui.externaltools.ExternalToolBuilder
            
                
                    LaunchConfigHandle
                    <project>/.externalToolBuilders/myprojectantlaunch.launch
                
            
        
    
    

    If the Ant build and Eclipse build have differing output locations, Eclipse may not be able to locate the test class on the classpath. In the case of an Ant builder, also check the configured targets for clean, auto, manual and after-clean builds, to ensure that the target which builds the unit tests is called.

提交回复
热议问题