JUnit: NoClassDefFoundError: org/junit/runner/manipulation/Filter

后端 未结 3 1034
暗喜
暗喜 2021-02-05 08:50

When I try to run some unit tests, the following error is raised:

java.lang.NoClassDefFoundError: org/junit/runner/manipulation/Filter
    at java.lang.Class.for         


        
3条回答
  •  南方客
    南方客 (楼主)
    2021-02-05 09:08

    Even I was facing the same issue, so try the below steps -

    1. Right click the project in Package Explorer, and click Properties.
    2. Click the Libraries tab.
    3. Click the Add library button.
    4. Select JUnit and click Next.
    5. Select JUnit 4 (that's what I am using).
    6. Click finish.
    7. Now right click the file containing unit tests and select Properties.
    8. Under the Run/Debug settings, remove any entries from the Launch Configurations for that file. Hit ok.

    Hopefully you'll be able to run the tests now.

提交回复
热议问题