Solved

maven project error

Posted on 2016-11-20
5
53 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
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 35

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 35

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 95
eclipse shortcuts 9 54
diffSum example 4 36
servlet example 11 40
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

816 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

8 Experts available now in Live!

Get 1:1 Help Now