Class Not Found Exception when running JUnit test

前端 未结 25 890
夕颜
夕颜 2020-12-07 08:32

I am getting this error when running JUnit test in Eclipse:

Class not found com.myproject.server.MyTest
java.lang.ClassNotFoundException: com.myproject.serve         


        
25条回答
  •  忘掉有多难
    2020-12-07 09:06

    In my case I had a wrong maven directory structure.

    Which should be like:

    /src/test/java/ com.myproject.server.MyTest

    After I fixed that - everything worked like a charm.

提交回复
热议问题