5

I have recently installed centOS. I am trying to run a maven project on Intellij IDEA, I get the following output on my console:

**[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.424 s
[INFO] Finished at: 2018-06-24T11:40:34+05:30
[INFO] Final Memory: 31M/290M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project sarvm: 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 debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException**

Any help will be greatly appreciated.

Myth
  • 201
  • 1
  • 3
  • 7
  • Which jdk did you install? If it's the openjdk please see [here](https://stackoverflow.com/questions/26313902/maven-error-perhaps-you-are-running-on-a-jre-rather-than-a-jdk). You might have a jre. – geco17 Jun 24 '18 at 06:56
  • Thank you for your prompt response. When i see my java -version it gives following output: openjdk version "1.8.0_171" OpenJDK Runtime Environment (build 1.8.0_171-b10) OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode) – Myth Jun 24 '18 at 07:00
  • Try `javac -version` to check the jdk – geco17 Jun 24 '18 at 07:07
  • 2
    You were correct, i had jre. I reinstalled OpenJDK 8 JDK using sudo yum install java-1.8.0-openjdk-devel and it worked. Thanks – Myth Jun 24 '18 at 07:11
  • Great, glad I helped. I've marked the question as a duplicate. – geco17 Jun 24 '18 at 07:16

0 Answers0