当前位置: 技术问答>java相关
java小问题,请入。
来源: 互联网 发布时间:2015-03-04
本文导语: 一个java 小程序,javac 可过,但java 时出下列错误,请问是什么意思?? Exception in thread "main" java.lang.NoClassDefFoundError: BasicsDemo source codes: public class BasicsDemo { public static void main(String[] args) { String copyFrom...
一个java 小程序,javac 可过,但java 时出下列错误,请问是什么意思??
Exception in thread "main" java.lang.NoClassDefFoundError: BasicsDemo
source codes:
public class BasicsDemo {
public static void main(String[] args) {
String copyFromMe = "Copy this string until you " + "encounter the letter 'g'.";
StringBuffer copyToMe = new StringBuffer();
int i = 0;
char c = copyFromMe.charAt(i);
while (c != 'g') {
copyToMe.append(c);
c = copyFromMe.charAt(++i);
}
System.out.println(copyToMe);
}
}
Exception in thread "main" java.lang.NoClassDefFoundError: BasicsDemo
source codes:
public class BasicsDemo {
public static void main(String[] args) {
String copyFromMe = "Copy this string until you " + "encounter the letter 'g'.";
StringBuffer copyToMe = new StringBuffer();
int i = 0;
char c = copyFromMe.charAt(i);
while (c != 'g') {
copyToMe.append(c);
c = copyFromMe.charAt(++i);
}
System.out.println(copyToMe);
}
}
|
比如你的classpath=g:javajdk1.3LIBdt.JAR;
你就在classpath中加入一个“.”
classpath=g:javajdk1.3LIBdt.JAR;.
^
该点就表示你的当前目录了
你就在classpath中加入一个“.”
classpath=g:javajdk1.3LIBdt.JAR;.
^
该点就表示你的当前目录了