本文介绍了设置java类路径(用于超级开发模式)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在OSX.7中使用命令
$ b $运行jar, gwt-codeserver.jar
-codeserver.jar com.activegrade.TeacherView
命令执行失败:
线程main中的异常java.lang.NoClassDefFoundError:com / google / gwt / core / ext / TreeLogger
导致:java.lang .ClassNotFoundException:com.google.gwt.core.ext.TreeLogger $ javab.URLClassLoader
$ 1.run(URLClassLoader.java:202)
...
但gwt-dev.jar包含com.google.gwt.core.ext.TreeLogger的定义,所以我断定我' m没有正确设置类路径。
我是否正确设置类路径? jar文件绝对是正确的jar,它绝对在那个位置。如何进一步诊断? 解决方案
是问题的根源吗? 当使用-jar选项时,JAR文件是所有用户类的源代码,而其他用户类路径设置将被忽略。
I'm trying to run a jar, gwt-codeserver.jar, in OSX.7, with the command
java -cp ".:/sdk/gwt-2.5.0.rc1/gwt-dev.jar" -jar /sdk/gwt-2.5.0.rc1/gwt-codeserver.jar com.activegrade.TeacherView
The command fails with:
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/gwt/core/ext/TreeLogger
Caused by: java.lang.ClassNotFoundException: com.google.gwt.core.ext.TreeLogger
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
...
But gwt-dev.jar contains the definition for com.google.gwt.core.ext.TreeLogger, so I've concluded that I'm not properly setting the classpath here.
Am I setting the classpath correctly? The jar file is definitely the right jar and it's definitely at that location. How can I diagnose this further?
解决方案
Could this be the source of your problem? "When you use the -jar option, the JAR file is the source of all user classes, and other user class path settings are ignored."
这篇关于设置java类路径(用于超级开发模式)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!