I have a maven project forked and cloned from a git repo onto my eclipse. It is build on Java 8. The first thing i do is perform a
mvn clean install
Doing this in pom.xml file and after updating the project, the problem is gone.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.4</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
Update the pom.xml under <plugin></plugin>
.
Update your project.
Then clean maven and install maven.
In my case, it was caused from an incompatibility with OpenJDK 9 (which I haven't investigated).
If you don't need JDK 9, a temporary work-around would be to purge it from your machine:
sudo apt-get remove --purge openjdk-9-jdk openjdk-9-jre
sudo apt-get remove --purge openjdk-9-jdk-headless openjdk-9-jre-headless
Buddy,
If every this is up-to-date, even then you are having this problem, then
try running this command from the terminal directly instead of running from eclipse.
$ mvn clean install
and make sure these things:
for it was comming because of java version mismatch ,so I have corrected it and i am able to build the war file.hope it will help someone
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
The below pom.xml configuration is making the build successful and make sure project buildpath JRE System library should point to Java8.
org.apache.maven.pluginsmaven-compiler-plugin3.7.0 1.81.8
Worked by adding this in pom.xml:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Even you have SDK 13 or 14.