exception in thread "main" java.lang.noclassdefounderror:
来源:百度知道 编辑:UC知道 时间:2024/05/20 00:17:20
E:\>javac JDBC.java
E:\>java JDBC
就出现exception in thread "main" java.lang.noclassdefounderror:JDBC
怎么往下做?
不要说我的环境变量有问题,我现在为变量晕了!
E:\>java JDBC
就出现exception in thread "main" java.lang.noclassdefounderror:JDBC
怎么往下做?
不要说我的环境变量有问题,我现在为变量晕了!
文件中的共有类必须和文件名相同,既然你编译通过了,,说明没有问题,看看你源代码中有没有定义包,就是开头的package,有的话要这样运行,比如你的文件在E:\java\JDBC.java,如果定义包“package myjdbc;”,那么生成后的class文件就在E:\java\myjdbc\JDBC.class。
执行下列语句运行:
java.exe -classpath "E:\java" myjdbc.JDBC
可能是这样。
你的主函数没有在class JDBC 里面,所以编译正常,但执行过程种找不到入口。
你要看一下 你的主函数main在哪个类里面
比如它在class xxx{
main
}
里面
那么你编译的时候可以写E:\>javac JDBC.java
执行的时候就要写E:\>java xxx
找不到JDBC类,检查你的JDBC.java里面是否有定义JDBC类
Exception EOleSysError in module
英语作文,主题:in th park
Realistic novel in the 18th century
on June 5th和in June
Christmas in the 13th Month
nothing in thé world 是什么意思?
Report ranks China 6th in overall strength 怎么翻译?
谁能告诉我feminism in 17th century 在英国
The film was released on 11th July in China
Fashions in America before the 19th century_____those of Egland.