[Eclipse] Could not find the main class. Program will exit
2012-09-13 16:37
411 查看
问题说明:
class中明明有main函数,但是执行之后就会出现Could not find the main class. Program will exit 的对话框,也没有编译错误提示。
问题根源:
主要是因为java文件没有被编译生成class文件,毕竟最后执行的是class文件。找到工程目录下的./bin/目录下的对应文件夹下面查看有没有生成class文件。
没有class文件,可能是因为编译错误,但是不知道为什么,eclipse也没有提示有编译错误。
然后修改了一下代码,突然就提示编译错误。
最后,Could not find the main class. Program will exit问题应该只是跟class文件有没有生成有关。
class中明明有main函数,但是执行之后就会出现Could not find the main class. Program will exit 的对话框,也没有编译错误提示。
问题根源:
主要是因为java文件没有被编译生成class文件,毕竟最后执行的是class文件。找到工程目录下的./bin/目录下的对应文件夹下面查看有没有生成class文件。
没有class文件,可能是因为编译错误,但是不知道为什么,eclipse也没有提示有编译错误。
然后修改了一下代码,突然就提示编译错误。
最后,Could not find the main class. Program will exit问题应该只是跟class文件有没有生成有关。
相关文章推荐
- JAVAEclipse:could not find the main class,program will exit!
- Eclipse 运行项目抛UnsupportedClassVersionError弹出yunCould not find the main class.program will exit
- Eclipse运行异常:Could not find the main class. Program will exit.
- Eclipse 出错:Could not find the main class. Program will exit
- 错误处理:could not find the main class, Program will exit
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法 .
- could not find the main class .program will exit的解决方案
- Could not find the main class. Program will exit
- Could not find the main class: org.apache.catalina.startup.Boostrap. Program will exit
- 转:could not find the main class, Program will exit (说明编译器compiler版本要不高于installed JREs,JVM版本)
- jdk版本不同造成问题解决could not find the main class, Program will exit(2)
- Could not find the main class: *****.Program will exit
- Could not find the main class ***.Program will exit
- java调用本地方法的时候报错 could not find the main class:xx.program will exit
- Debian配置JAVA环境报错之Could not find the main class: HelloWorld. Program will exit.
- Could not find the main class Program will exit
- Eclipse下编译出现错误:can not find the main class,Program will exit 问题解决
- 解决java virtual machine launcher could not find the main class. program will exit
- 解决运行java application时提示Could not find the main class.Program will exit.问题
- Java中Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 的解决方法