If an error that's stating 'no compiler is provided in this environment. perhaps you are running on a jre rather than a jdk?' is displayed, then these steps have to be performed:
- Right-click on the Project. Select Properties and go to the Compiler section.
- Verify that the compiler compliance level is set at 1.8 since we are using Java 8, as shown in the following screenshot:
- Go to Window | Preferences and verify that the JDK 1.8 checkbox is checked, as shown in the following screenshot:
Once these settings are done, the aforementioned error will no longer appear.