Solved

maven project error

Posted on 2016-11-20
5
107 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 7

Author Comment

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

Accepted Solution

by:
micropc1 earned 250 total points
ID: 41895201
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 36

Assisted Solution

by:mccarl
mccarl earned 250 total points
ID: 41895203
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
ID: 41895205
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 36

Expert Comment

by:mccarl
ID: 41895207
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
A solution for Fortify Path Manipulation.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

630 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