我刚接触java,请高手赐教!有一问题...(100分)

H

hhcz

Unregistered / Unconfirmed
GUEST, unregistred user!

我在rdhat下写的简单的测试程序如下:

import java.util.*;
import java.lang.*;
public class test{
public static void main(String args[]){
System.out.println(" this is in linux");
}
}

保存为test.java
运行 > javac test.java
编译通过并生成test.class文件
运行 > java test
报错如下 :
Exception in thread "main" Java.lang.NoclassDefFoundErro:test
但是这个在linux下编译的test.class在windows 下运行正常。
请问这是怎么回事?是不是我的linux 下的jdk配置有问题?
 
classpath中有没有包括当前目录:./
 

I really thank you!
 

Similar threads

K
回复
2
查看
196
naughtboy
N
Q
回复
13
查看
150
qddmh
Q
回复
8
查看
201
小猪
顶部