junit:could not find the main class Program will exit
2012-01-01 16:39
399 查看
大家好:
这是我第一次写博客,希望能帮助到大家。
首先描述一下我遇到的问题:我用的是myeclipse6.5,junit本来是好使的,但是无缘无故突然在运行时报“could not find the main class Program will exit”提示错误,无法使用。
解决问题的过程:
我就上网找了一些博主发表的文章,大部分都是在说环境变量等设置有问题,其实我已经设置了环境变量,但是没有其他办法我就开始反复设置环境变量,但是还是不行。
为了证明不是环境变量的问题,我又安装了eclipse3.4,发现在eclipse下是没有问题,由此证明该问题的出现不一定是环境变量问题所导致的。
然后此问题就搁置了,直到今天我上网发现一个美国朋友发表的一篇有关该问题的文章的回复中提到了工作空间的可能会影响到该问题。我就重新创建了一个工作空间,在里面新建了一个项目,然后写测试类,运行junit,发现可以了。
然后我就将原来工作空间中的.metadata删除,然后将项目重新引入进来。
至此,该问题就已经全部解决了。
希望该文章可以帮助到和我有同样问题的同学。
Dustin
这是我第一次写博客,希望能帮助到大家。
首先描述一下我遇到的问题:我用的是myeclipse6.5,junit本来是好使的,但是无缘无故突然在运行时报“could not find the main class Program will exit”提示错误,无法使用。
解决问题的过程:
我就上网找了一些博主发表的文章,大部分都是在说环境变量等设置有问题,其实我已经设置了环境变量,但是没有其他办法我就开始反复设置环境变量,但是还是不行。
为了证明不是环境变量的问题,我又安装了eclipse3.4,发现在eclipse下是没有问题,由此证明该问题的出现不一定是环境变量问题所导致的。
然后此问题就搁置了,直到今天我上网发现一个美国朋友发表的一篇有关该问题的文章的回复中提到了工作空间的可能会影响到该问题。我就重新创建了一个工作空间,在里面新建了一个项目,然后写测试类,运行junit,发现可以了。
然后我就将原来工作空间中的.metadata删除,然后将项目重新引入进来。
至此,该问题就已经全部解决了。
希望该文章可以帮助到和我有同样问题的同学。
Dustin
相关文章推荐
- jdk版本不同造成问题解决could not find the main class, Program will exit(2)
- Could not find the main class: org.elasticsearch.bootstrap.Elasticsearch. Program will exit.
- Could not find the main class. Program will exit...
- could not find the main class, Program will exit(已解决)
- Could not find the main class: *****.Program will exit
- Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 错误的解决办法
- 问题解决了,可是为什么呢?could not find the main class.program will exitmain
- Java执行main方法,异常为: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
- 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."
- 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
- runnable jar 不能在win7打开,显示错误: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
- JAVAEclipse:could not find the main class,program will exit!