Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 14
    try running mvn clean test once it will compile all the test classes Commented Jul 8, 2012 at 6:47
  • 1
    Can you please check if com.myproject.server.MyTest is there in bin folder? I mean if it is not compiled due to compile or build path error you will get this error.
    – vikas
    Commented Jul 8, 2012 at 12:22
  • are you testing one class or the whole project?
    – Doszi89
    Commented Jul 10, 2012 at 8:46
  • Possible duplicate of Eclipse - java.lang.ClassNotFoundException Commented Dec 11, 2015 at 1:22
  • 2
    In my case running tests using Maven worked, but if I right-click on a test class and choose Run As -> JUnit Test, it reported ClassNotFoundException. I fixed it by right-clicking on the project and going to Properties -> Builders and then moving Maven Project Builder above the Java Builder
    – xorcus
    Commented Mar 29, 2016 at 21:45