0
내 Mac 터미널에서이 명령 블록으로 r.js (require.js optimizer)를 실행하려고합니다. 흥미롭게도 터미널에 java를 입력하면 오류가 발생합니다. Mac에는 기본적으로 Java가 설치되어 있습니다.MacOS X에서 r.js를 실행할 때 NoClassDefFoundError
java \
-classpath \ //maybe classpath is wrong?
js.jar \ //this is a java file required for the optimization
org.mozilla.javascript.tools.shell.Main \ //specific part of the .jar file is called
r.js \ //this is the optimizer's js file
-o \ //telling it to optimize
build.js //this is the config file
build.js :
({
baseUrl: '../public/sites/triathlonresearchnnb/js', //where to look in
mainConfigFile: '../public/sites/triathlonresearchnnb/js/main.js', //dir of our main file
name: '../Scripts/main', //which one
out: '../public/sites/triathlonresearchnnb/js/scripts.min.js', //final concatenated and minified product path
})
명령 줄에서
자바 오류 :
Exception in thread "main" java.lang.NoClassDefFoundError:
Caused by: java.lang.ClassNotFoundException:
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
오류 메시지를 보면 오류 메시지의 어느 부분이 없거나 (찾을 수없는 클래스의 이름) Java가 이름없이 클래스를로드하도록 지시하고있는 것으로 보입니다. 'org.mozilla.javascript.tools.shell.Main'은 확실히 발견되었습니다. 그렇지 않은 경우 오류 메시지는 Error : 메인 클래스 org.mozilla.javascript.tools.shell.Main을 찾거나로드 할 수 없기 때문입니다. '. –
찾을 수없는 클래스가'Class.forName'이 아닌 암시 적으로로드되었다는 것을 알 수 있습니다. 그렇지 않으면'ClassNotFoundException'이됩니다. –
Windows 또는 Linux 컴퓨터에서 동일한 단계를 수행 할 수 있습니까? 그렇다면 동일한 오류가 발생하면 신고하고 신고하십시오. 'js.jar'와'r.js' 파일을 어디에서 다운로드 했는지도 알려주십시오. –