简体   繁体   中英

Eclipse Oxygen 4.7.2: Cannot find class 'junit.framework.TestCase' on project build path

I am trying to create a run configuration for my unit test in Eclipse Oxygen 4.7.2, but always get the error

Cannot find class 'junit.framework.TestCase' on project build path.

The configuration wizard looks like this:

在此处输入图像描述

Where the "test" folder contains several.java files with test methods (ie methods with the "@Test" tag).

What do I have to do to make it work?

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.target>8</maven.compiler.target>
    <maven.compiler.source>8</maven.compiler.source>
</properties>

add this to your pom.xml file. then right click your project go to "Maven->updateProject"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM