NoClassDefFoundError
NoClassDefFoundError는 개발하면서 종종 접하게 되는 Error입니다. Class로딩 단계에서 Class를 찾을 수 없을때에 발생합니다.
java doc에는 다음과 같이 소개되어 있습니다.
Thrown if the Java Virtual Machine or a ClassLoader
instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new
expression) and no definition of the class could be found.
The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found.
만약 NoClassDefFoundError가 생겼다면 이는 실행시 참조하는 class를 찾을 수 없다는 에러로 classpath에 원하는 패키지가 잘 설정되어 있는지 확인해 보시기 바랍니다. 그리고 classpath를 적을 때, 실행을 원하는 위치를 입력하는게 좋습니다.
예를 들면 classpath=.;