There is no Error at all. I can compile and run this program in my computer!!!
create a run.bat as the following 2 lines to run it:java Welcome
pause
(you must put this bat file and the Welcome.class file in the same directory!)
create a run.bat as the following 2 lines to run it:java Welcome
pause
(you must put this bat file and the Welcome.class file in the same directory!)
解决方案 »
- 一道程序设计题....用java如何实现
- 执行executeQuery()直接导致程序结束后续代码不执行了,为什么?
- 小程序载入问题
- 求助,在JAVA里面如何读取文件的最后N行的数据啊?(每一行的数据长度不定)急!!
- 求助,我这里写的猜字母游戏有点小问题,请大哥大姐们看看哪里有问题啊!
- j2sdk-doc 的阅读问题?(来者给分)
- 求3DES 算法加密算法程序.谢谢!
- 我从网上下载了包ftp.jar,classpath里也设置了,可就是不能调用
- 200分,200分,不是很难的jni问题啊!但我困惑中………………………
- 请问:java中如何保存和调用一个对话中的值?
- 日文内码问题
- jdk中如何将编译后的错误信息输出到文本文件中
ClassPath= %ClASSPATH%;.
注意后面的点!
javac Welcome.java
java Welcome
你运行java之前 先运行一下setenv.bat把CLASSPATH设好
凡是 Exception in the thread "main" java.lang.NoClassDefFoundError:XXX
都是因为在类路径中没找到
1.在我的电脑上点鼠标右键,选择“属性”,在出来的画面中选第四个选项框“高级”
2.在选到的画面上点击第二项“环境变量”,然后你就可以看到怎么设置path和classpath
3.一般path这个变量都会有,所以你只需要点中编辑就可以了,加上c:\jdk1.3\bin(注意,如果前面有东西,记得要用“;”分开,而且这是我的目录,你可不一定在C盘哦)
4.新增一个变量,变量名classpath,然后参数就是“.;c:\jdk1.3\lib\tools.jar”,其中非常要注意这个点,他妈的就是这个点让我这个初学者搞了半天,其他如上。
5.如果你设置好了,你进入到DOS模式,输入echo %classpath%,看看出来的结果是否和你设置的一样,如果一样,恭喜你,你顺利过了第一关,我暂时还只过了第一关,呵呵。