Good. Same as Mine. Go to My computer|properties|advanced|environment variables..., search for classpath in both user and system, make a note of them and then delete. restart your PC and see if it will work.
what note: path = D:\j2sdk1.4.1_01\binclasspath = D:\j2sdk1.4.1_01\lib\tools.jar;D:\j2sdk1.4.1_01\lib\dt.jar; 我原来就是那么设定的阿,结果出现了这样的错误
然后我就用 java Property,可是不行啊,只出现了上面那个错误
但如果用下列命令:java Property.class
则得到:
Exception in thread "main" java.lang.NoClassDefFoundError: Property/class想再试试?
就是这个东东
把文件保存成Property.javajavac Property.java
无错误
java Property
出错
c:xxx>javac Property.java
c:xxx>java Property
xxxxx error
E:\JavaProj>javac Property.javaE:\JavaProj>java Property
Exception in thread "main" java.lang.NoClassDefFoundError: Property
找了半天才找到原因,由于我的系统classpath和jcreator的classpath设置临时为了需要而改变了引起的。不知道你的情况是怎样的。
驱动器 E 中的卷没有标签。
卷的序列号是 C87F-A161 E:\JavaProj 的目录2003-01-05 15:25 711 Assignment.class
2003-01-05 15:25 206 Number.class
2003-01-05 15:43 1,043 Property.class
3 个文件 1,960 字节
0 个目录 2,688,229,376 可用字节E:\JavaProj>
copy Property.class E:\
cd ..
java PropertySee what will happen.
我的Property.class与你的大小一样.
E:\JavaProj>copy Property.class e:\
已复制 1 个文件。E:\JavaProj>cd..E:\>java Property
Exception in thread "main" java.lang.NoClassDefFoundError: Property
set classpath=
java Property祝好运!
set classpath=
java Property
你应该能得到结果了.
还有,我安装以后,没有进行设置,这样的话,javac命令就是用不了了,怎样设置呢?我是菜鸟,麻烦你了
Go to My computer|properties|advanced|environment variables..., search for classpath in both user and system, make a note of them and then delete. restart your PC and see if it will work.
path = D:\j2sdk1.4.1_01\binclasspath = D:\j2sdk1.4.1_01\lib\tools.jar;D:\j2sdk1.4.1_01\lib\dt.jar;
我原来就是那么设定的阿,结果出现了这样的错误