1、eclipse运行java报错
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
module tp10: java.lang.NoClassDefFoundError
如下图:
Eclipse版本:2018-12
Java版本:12.0.1
解决方法:
1、安装jre。在jdk下运行
bin\jlink.exe --module-path jmods --add-modules java.desktop --output jre
2、在eclipse通过window-》Preferences-》Java-》Installed JREs添加或编辑已安装的jre路径
再次运行,就可以啦。