I am using eclipse as IDE. When I right click on the project and then click maven update my java version change to 1.5. Here is what I did so far, I followed all the steps listed here
I changed "Java build path" to "workspace default jre 1.8.0_25"
Then changed "java compiler" to 1.8
Then changed "project facets">java>1.8
Changed pom.xml java version to 1.8
org.eclipse.jetty
jetty-maven-plugin
9.1.3.v20140225
org.apache.maven.plugin
maven-compiler-plugin
3.1
1.8
1.8
After all this when I click on "Maven update" my java version change to 1.5 automatically. Also in above steps, first two step's version also change to 1.5 automatically. How can I fix this?
解决方案
Open your pom.xml file and add the following lines on it:
1.8
1.8
Where 1.8 is the java version of your current JDK/JRE. Another way of doing this is adding a with the maven-compile-plugin as
org.apache.maven.plugins
maven-compiler-plugin
3.2
1.8
1.8