java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing in Intellij

前端 未结 4 1111
难免孤独
难免孤独 2021-01-17 07:12

I used Intellij Idea 12 Community edition. I am trying to create test case for my class by creating test case. When i run my test case it says

java.lang.NoC         


        
4条回答
  •  梦谈多话
    2021-01-17 07:57

    If you come across this (and a few other threads) on this error and adding the jar to dependencies doesn't work, you will need to add to the general java classpath.

    I encountered this error in OSX where maven would download the dependency, but not find it when in fork mode.

    Adding all the hamcrest jars to Library/Java/Extensions finally fixed the problem when nothing else would.

提交回复
热议问题