Solved

maven project error

Posted on 2016-11-20
5
17 Views
Last Modified: 2016-11-20
Hi,
I am trying maven simple java example of Calculator which adds couple of numbers on new windows laptop with eclipse Luna on it.

I right clicked on Calculator project and Run As Maven Clean that cleaned well. When again right clicked and Run As maven install getting below error.

[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building calculator 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom
[INFO] Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom (7 KB at 9.0 KB/sec)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ calculator ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\gpEclipse_workspace\calculator\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ calculator ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to C:\Users\gpEclipse_workspace\calculator\target\classes
[INFO] -------------------------------------------------------------
COMPILATION ERROR :
[INFO] -------------------------------------------------------------
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: 3.149 s
[INFO] Finished at: 2016-11-20T19:43:12-05:00
[INFO] Final Memory: 10M/133M
[INFO] ------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project calculator: Compilation failure
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
-> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException



I wonder why i get this error. and how to resolve this
I checked eclipse window-->preferences--java--compiler--jdk compliance set to comiler compliance level to 1.8 in disabled drop down box

please advise
0
Comment
Question by:gudii9
  • 2
  • 2
5 Comments
 
LVL 7

Author Comment

by:gudii9
Comment Utility
window-->preferences--java--compiler-
installed JRE has JRE1.8 though
0
 
LVL 7

Accepted Solution

by:
micropc1 earned 250 total points
Comment Utility
You need to use the JDK - not the JRE. Download the JDK and add the JDK libraries to your project in the configuration.
0
 
LVL 35

Assisted Solution

by:mccarl
mccarl earned 250 total points
Comment Utility
So the error message should be pretty obvious then...      
No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
0
 
LVL 7

Author Comment

by:gudii9
Comment Utility
when i swirched to JDK1.8 under "Installed JRE" it worked.

Is it not misnomer to give JDK under eclipse "Installed JRE" (as the name says Installed JRE and we are changing default JRE 1.8 to JDK 1.8)

Also why Run As Maven Compile is happy with JRE 1.8
where as
Run As Maven Install is not happy about JRE 1.8 but only happy with JDK1.8??
0
 
LVL 35

Expert Comment

by:mccarl
Comment Utility
Is it not misnomer to give JDK under eclipse "Installed JRE"

Take it up with Eclipse developers, I guess.

Also why Run As Maven Compile is happy with JRE 1.8
where as
Run As Maven Install is not happy about JRE 1.8 but only happy with JDK1.8??

I assume you meant to type "Clean" not "Compile"... anyway. "Maven clean" only deletes files where as "Maven install" has to compile the class from source files hence it needs the java compiler (javac.exe) that comes with JDK
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now