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路徑
再次運行,就可以啦。