What causes imported Maven project in Eclipse to use Java 1.5 instead of Java 1.6 by default and how can I ensure it doesn't?

前端 未结 13 2146
情深已故
情深已故 2020-11-27 09:51

I imported a Maven project and it used Java 1.5 even though I have 1.6 configured as my Eclipse default Preferences->Java->Installed JREs.

When I

13条回答
  •  粉色の甜心
    2020-11-27 10:17

    I found that my issue was someone committed the file .project and .classpath that had references to Java1.5 as the default JRE.

    
        
            
        
    
    

    By closing the project, removing the files, and then re-importing as a Maven project, I was able to properly set the project to use workspace JRE or the relevant jdk without it reverting back to 1.5 . Thus, avoid checking into your SVN the .project and .classpath files

    Hope this helps others.

提交回复
热议问题