Getting error while running Maven Project?


#1

Hello Friends, I am new in Maven. I have created a maven project for Android App Automation Testing. The same project working fine on my home system but it is giving me the follwoing error. I don’t understand how to resolve it. Please help to rectify it

[INFO] Scanning for projects…
[INFO]
[INFO] -------------< HannaIOTWebsite:HannaIOTWebsiteTestProject >-------------
[INFO] Building HannaIOTWebsiteTestProject 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] — maven-resources-plugin:2.6:resources (default-resources) @ HannaIOTWebsiteTestProject —
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\AutomationWorkspace\HannaIOTWebsiteTestProject\src\main\resources
[INFO]
[INFO] — maven-compiler-plugin:3.6.1:compile (default-compile) @ HannaIOTWebsiteTestProject —
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 3 source files to C:\AutomationWorkspace\HannaIOTWebsiteTestProject\target\classes
[INFO] -------------------------------------------------------------
[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: 0.993 s
[INFO] Finished at: 2019-06-06T16:25:33+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project HannaIOTWebsiteTestProject: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[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


#2

https://www3.ntu.edu.sg/home/ehchua/programming/howto/JDK_Howto.html


#3

Thanks for the response. As per your suggestion. I tried both but it is not working but same code running on another system on the same configuration

Find below POM file dependencies and JDK setting attachment
pom.txt (2.0 KB)


#4

I’m going to quote part of the link that you apparently glossed over:

If you have previously installed older version(s) of JDK/JRE, un-install ALL of them. Goto “Control Panel” ⇒ (optional) “Programs” ⇒ “Programs and Features” ⇒ Un-install ALL programs begin with “Java”, such as “Java SE Development Kit …”, “Java SE Runtime …”, “Java X Update …”, and etc.


#5

I did some additional research because of your screenshot.