Could not find main class.

MyEclipse 导入项目之后 运行“Could not find main class. Program wll exit.”

报错:

bad version number in .class file

 

jdk版本问题

修改成一致

  1. Window --> Preferences -->Java --> compiler中的compiler compliance level对应的下拉菜单中选择JDK版本. 

  2. Window --> Preferences -->MyEclipse --> Servers -->Tomcat --> Tomcat n.x -->JDK中的Tomcat JDK name下的下拉菜单中选择自身电脑上安装的JDK版本(必需与步骤1中的JDK版本一致). 如果还是没有解决,不用焦急,因为有些MyEclipse版本自带有JDK版本,所以也要将它改过来. 
  3. Window --> Preferences -->Java -->Installed JRES,然后在右边选择与步骤1和2版本一致的JDK版本,如果没有,可以自身添加.然后选中就可以了.

 

查了好久,也是笨。

 

我改步骤 1 为6.0

 改步骤 3 为 1.7 也是ok

 

参考:http://jingyan.baidu.com/article/acf728fd21f2e7f8e510a3de.html

posted @ 2015-05-19 16:18  丶再睡一夏  阅读(193)  评论(0编辑  收藏  举报