Maven “build path specifies execution environment J2SE-1.5”, even though I changed it to 1.7

后端 未结 11 1549
天涯浪人
天涯浪人 2020-11-27 12:00

In Eclipse Juno, I installed the latest m2e plugin (1.2.20120903-1050). In preferences, I have added jdk1.7.0_11 in Java -> Installed JREs -> Add, and then specified the lo

11条回答
  •  天涯浪人
    2020-11-27 12:37

    In order to update your project to the latest version of java available in your environment, follow these steps:

    1. Open your pom.xml file
    2. Switch your view to Effective POM tab
    3. Open Find Dialog (ctrl + F) to search for maven-compiler-plugin
    4. Copy the the following lines

    
    	maven-compiler-plugin
    	3.1

    1. Click on pom.xml tab to open your project pom configuration
    2. Inside your ... configuration section, paste the configuration copied and modify it as...

            
        	
        		maven-compiler-plugin
        		3.1
        
        		
        			1.8
        			1.8
        		
        	
        

    1. save your configuration
    2. Right Click in your project Click on [Maven -> Update Project] and Click on OK in the displayed update dialog box.

    Done!

提交回复
热议问题