i created a webapp project using maven in eclipse. when i run the command mvn package in command prompt it showing folowing error.
[ERROR] COMPILATION ERROR
After creating a second workspace to work in a separate source code branch, I ran into a bizarre situation where I could do a Maven build from the command line in the new workspace, but not in Eclipse. I tried setting the JRE configuration to the JDK as described by others, but still no luck. I finally had to search the entire contents of the new workspace's .metadata directory to find the offending files that refused to be reconfigured. The main culprit was
.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs
It still pointed to the wrong directory despite my configuration change. I did a manual edit to supply the correct JDK name and location. I also edited the files under
.plugins/org.eclipse.debug.core/.launches
These all likewise pointed to the JRE instead of the JDK. Once these edits were made, I could build projects in the second workspace from within Eclipse, not just from the command line.