1

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?

Aron
  • 21
  • 1
  • 2
  • 4
  • 1
    Possible duplicate of [No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?](https://stackoverflow.com/questions/19655184/no-compiler-is-provided-in-this-environment-perhaps-you-are-running-on-a-jre-ra) – akuma8 Jun 03 '18 at 02:55

2 Answers2

3

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

Paul Warren
  • 2,411
  • 1
  • 15
  • 22
  • Thanks Paul, I would like to share my screen shots, but i don't know how. how can I share my screen shots showing all the settings I currently have ? – Aron Jun 07 '18 at 02:53
  • Perhaps edit your original question. That will allow you to attach screenshots from your computer – Paul Warren Jun 07 '18 at 04:39
  • Paul i have attached 2 screen shots showing installed JRE and libraries. please have a look. – Aron Jun 19 '18 at 02:19
0

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.

סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68