How to change Java version for Maven in IntelliJ?

后端 未结 8 2058
情书的邮戳
情书的邮戳 2020-12-05 01:43

I\'m new to both Maven and IntelliJ IDEA.

I have a Maven project written in Java 8. Whenever I try to build it (Maven Projects window -> Lifecycle -> compile -> Run

8条回答
  •  臣服心动
    2020-12-05 02:23

    You should add below code in your pom.xml to force the language level to change

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

    now intelliJ 2019.3 CE does this for you if you go to import then alt+enter where you will get an option saying "change language level to 8 to use this functionality"

提交回复
热议问题