How to solve java.lang.NoClassDefFoundError?

前端 未结 27 2099
暗喜
暗喜 2020-11-21 06:04

I\'ve tried both the example in Oracle\'s Java Tutorials. They both compile fine, but at run-time, both come up with this error:

Exception in thread \"main\"         


        
27条回答
  •  不要未来只要你来
    2020-11-21 06:36

    In my environment, I encounter this issue in unit test. After appending one library dependency to *.pom, that's fixed.

    e.g.:

    error message:

    java.lang.NoClassDefFoundError: com/abc/def/foo/xyz/Iottt
    

    pom:

    
        com.abc.def
        foo
        test
    
    

提交回复
热议问题