这是使用swt图形界面时遇到的问题:
报错信息:
Eclipse is running under 1.7, but this Java project has a 1.8 Java compliance level, so WindowBuilder will not be able to load classes from this project. Use a lower level of Java for the project, or run Eclipse using a newer Java version.
总结下就是版本不一致导致的。
解决办法:
1,***eclipse->窗口->首选项->java->编译器->都设成1.7。
2.***eclipse->窗口->首选项->java->已安装的JRE->选择1.7.
3.重启eclipse!
4.更改当前工程版本为1.7!