Java version automatically change to java 1.5 after maven update

前端 未结 11 522
盖世英雄少女心
盖世英雄少女心 2020-12-22 17:29

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 l

11条回答
  •  鱼传尺愫
    2020-12-22 17:59

    Had the same issue when I installed Java 9. My project would default to J2SE-1.5 Execution Environment. Strangely, Java 9 compliance level is not referenced like previous versions, i.e. "1.8", but as "9". So I had to provide my properties and Maven compiler plugin config accordingly:

    
        9
        9
    
    

    and

    
        org.apache.maven.plugins
        maven-compiler-plugin
        
            9
            9
        
    
    

    This seems to have solved the problem. Works for versions 9 and above.

提交回复
热议问题