编译错误:It is indirectly referenced from required.class files

完整错误信息:


Errors(2 item)

1.The type java.lang.Enum cannot be resolved. It is indirectly referenced from required.class files.

2.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


一般是包丢失的问题,只要导入缺失的包,就可以解决问题。


可能的原因是,缺失JRE System Library[jdk]的一些包,或者是机子上装了多个版本的
jre或者jdk的原因。可以手动确定:
1.进入
Window \ Preferences\Java\Installed JREs,点击“Add”按钮,输入JRE name(名称)和
JRE home directory(jre安装路径,如:C:\Java\jdk)
2.右键选中工程名称,选择properties\Java Bulid Path ,点击“Add Library”按钮,
选中“JRE System Library”,按“Next”,选择“Workspace default JRE(jdk)”,然后点击
“Finish”即可

你可能感兴趣的:(java,jdk,C++,c,C#)