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,

改为如图

原文地址:https://www.cnblogs.com/w123w/p/10741139.html