Apache Commons CLI 1.2를 사용하여 Java에서 명령 줄 인수를 구문 분석합니다. 내 자바 클래스를 실행하려고 할 때 NoClassDefFoundError
을 실행했지만 클래스 경로를 수정하여 해결했습니다. 아래 그림과 같습니다 Java : NoClassDefFoundError (Apache Commons CLI 1.2 사용)
commons-cli
클래스에 관해서 있습니다
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cl i/CommandLineParser Caused by:
java.lang.ClassNotFoundException: org.apache.commons.cli.CommandLineP arser
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source) Could not find the main class: com.amirsys.score.api.script.CMDContentPusher.
내가 생각할 수있는 유일한 방법은 공유지 - CLI 병에 대한 클래스 경로를 설정하는 것입니다하지만, 그것은 작동하지 않았다. 가져온 클래스에 대해 NoClassDefFoundError
을 수정하는 솔루션을 찾을 수 없었습니다. 나는 이것들이 .class 파일들로 컴파일되었다고 생각했다.
이것은 유용 할 수 있습니다 : http://stackoverflow.com/questions/1457863/what-is-the-difference-between-noclassdeffounderror -and-classnotfoundexception –
응용 프로그램을 정확히 어떻게 실행합니까? 커먼즈 - 클라이가 클래스 패스에없는 것 같습니다 ... – centic
나는 윈도우 커맨드 라인에서 실행하려고했습니다. 그래서 나는 초기 경로에서 commons-cli에 클래스 경로를 추가 할 것인가? 나는 클래스 경로 구성의 원사 공에서 길을 잃을 것이라는 두려운 감정을 가지고 있습니다. 더 간단한 방법이 있습니까? –