0
votes

Installed JRE pointing to JDK & Libraries pointing to jre[Please note- there solutions out there Eclipse, but I'm using Sprint STS] Spring Tool Suite Version: 3.9.3.RELEASE Apache Maven 3.2.5 Java- 10.0.1 OS - Windows 10 Tomcat 8.5

I have already verified Installed JRE has a JDK entry. Have verified JAVA_HOME and Path environment variables.

Maven Clean & Validate works. Maven Compile does not work. Gives me error - "No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? "

Can someone please help?

2

2 Answers

1
votes

Your workspace needs to be configured with a JDK.

Goto Preferences->Java->Installed JREs and Add your JRE there. Point at a JRE (with a JDK).

enter image description here

Then right-click on your project and select Build Path->Configure Build Path->Libraries->Add Library to make sure that JRE is associated with your project.

enter image description here

0
votes

I faced same error while using spring tool suite 4 IDE.

To resolve these issues, follow these steps:

  • Right click on project
  • Select Build path option
  • Click on configure Build path
  • Go to libraries tab
  • Click on Add Library option
  • Select JRE System Library
  • Select Alternate JRE option
  • Click on installed JRE's button
  • Click on ADD
  • Select Standard VM
  • Click on directory
  • Select the path to JDK
  • Click Apply & Close.

That's it, issue was resolved and maven build was successful.

I hope this works for eclipse too. It worked for me.