|
发表于 2004-7-19 13:31:00
|
显示全部楼层
回复: 问一个java的基础问题,有关路径设置
最初由 toplazydog 发表
我在/etc/profile中设置路径如下:
#Java Environment
JAVA_HOME="/usr/local/jdk"
CLASSPATH="/usr/local/jdk/lib/tools.jar"
export CLASSPATH
PATH="$PATH:/usr/local/jdk/bin"
但是在编译一个小测试例子后
public class StringTest
{
public static void main(String [] args)
{
//String dog ="A quick brown fox jumps over the lazy dog.";
System.out.println("dog");
}
}
错误提示如下
[lazydog@lazydog string_test]$ java StringTest.class
Exception in thread "main" java.lang.NoClassDefFoundError: StringTest/class
请教是什么缘故
classpath=.:/usr/local/jdk/lib/tools.jar...... |
|