|
请大家帮帮我,我很着急
我安装的是/usr/java/jdk1.5.0_06/
javac没有问题
但运行时出现
[root@localhost java]# java Welcome1.class
Exception in thread "main" java.lang.NoClassDefFoundError: Welcome1.class
at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
Caused by: java.lang.ClassNotFoundException: Welcome1.class not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/java/jdk1.5.0_06/lib/tools.jar,file:./,file:/usr/java/jdk1.5.0_06/jre/lib/rt.jar,file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.6.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String) (/usr/lib/libgcj.so.6.0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.6.0.0)
at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
或者说 [root@localhost java]#java Welcome1
no suitable method `main' in class
好像是CLASSPATH的问题
CLASSPATH我设置的是[root@localhost java]# echo $CLASSPATH
/usr/java/jdk1.5.0_06/lib/tools.jar:/usr/java/jdk1.5.0_06/lib/td.jar:/usr/java/jdk1.5.0_06/jre/lib/rt.jar |
|