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
Solved

maven project error

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
print map entry 34 72
Way to decrease size of apk file 9 86
Can anyone please tell me why i can not find ID  investorCoolGrid inside the jsp page? 1 22
Java string replace 11 54
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
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 …

860 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