No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 其实就是没有配置jdk,eclipse默认配置的是jre. 如图,添加jdk就行 之后在项目上右键,选择build path-->configure 双击jre, 改为如图