Home > database >  Error Perhaps you are running on a JRE rather than a JDK?
Error Perhaps you are running on a JRE rather than a JDK?

Time:04-27

I try to run a project but gets this error. The computer is a new mac m1, previously this project was on windows

RROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project common-core: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debu

CodePudding user response:

In your Intellij in main menu go to this path:

File -> Project Structure -> Platform Settings -> SDKs

In order to add new JDK click on button and add JDK from your directory or just download a new one.

After that set your project's JDK:

File -> Project Structure -> Project Settings -> Project

In this path check the Project SDK and Project language level sections.


Two other important settings you should check for JDK for Maven that running in Intellij:

First:

File -> Settings -> Project -> Build, Execution, Deployment -> Build Tools -> Maven -> Importing

Here in this path check JDK for importer section.

Second:

File -> Settings -> Project -> Build, Execution, Deployment -> Build Tools -> Maven -> Runner

Here check JRE section.

  • Related