当前位置: 技术问答>java相关
求教java
来源: 互联网 发布时间:2015-02-01
本文导语: 我在win98上装了了jdk1.3.1,可有如下问题搞的我很头疼: javac总能编译成功,但是随后用java命令来执行编译生成的.class文件时总告诉我“Exception in thread "main" java.lang.NoClassDefFoundError:类名”。(“类名”就是指编译...
我在win98上装了了jdk1.3.1,可有如下问题搞的我很头疼:
javac总能编译成功,但是随后用java命令来执行编译生成的.class文件时总告诉我“Exception in thread "main" java.lang.NoClassDefFoundError:类名”。(“类名”就是指编译的那个类的名称)
请教各位大侠,谁能告诉我这是什么原因造成的,如何解决?小弟感激不尽
javac总能编译成功,但是随后用java命令来执行编译生成的.class文件时总告诉我“Exception in thread "main" java.lang.NoClassDefFoundError:类名”。(“类名”就是指编译的那个类的名称)
请教各位大侠,谁能告诉我这是什么原因造成的,如何解决?小弟感激不尽
|
It is the question of path. You can set path in the autoexec.bat. Please remember: you must add classpath that include the path of jdk/bin, jdk/lib,root.
You also need add jdk/lib into path.
classpath=.;d:/jdk/bin;d:/jdk/lib;
path=.....;d:/jdk/lib;
You can set all according to your environment.
If you still have question, you can ask me again. I will help you at any time.
You also need add jdk/lib into path.
classpath=.;d:/jdk/bin;d:/jdk/lib;
path=.....;d:/jdk/lib;
You can set all according to your environment.
If you still have question, you can ask me again. I will help you at any time.