Compile maven projects with JDK 1.6 in Eclipse Mars

半城伤御伤魂 提交于 2019-12-06 10:10:22

Download an version of Maven which support JDK 6 or hight, you can see in Maven Release History. I downloaded version 3.2.5.

After that open Eclipse Mars > Window > Preferences > Maven > Installations and add Maven 3.2.5, that click Apply then OK

Go back to Luna. Seriously. =)

Do you really wanna try Mars? Ok, go on...

Firstly, download an eclipse version for non-java devs (for c/c++ devs should do the trick).

Secondly, install the "Eclipse Java Development Tools" package (select "Install New Software..." under the "Help" menu). Restart eclipse.

Now, open the same window again. Add the repository from m2e project (http://download.eclipse.org/technology/m2e/releases), uncheck "Show only the latest versions of available software" and check the higher 1.5.x version from m2e plugin (currently 1.5.2.20150414-2215). Restart eclipse again.

Enjoy (and good luck).

m2e plugin in version >= 1.6 does not support Maven 2. If you want to install m2e plugin 1.5.x in Eclipse Mars with m2e 1.6 already installed (see row "Maven Integration for Eclipse" at. https://eclipse.org/downloads/compare.php?release=mars) you should:

  1. download Eclipse Luna Package with "Maven Integration for Eclipse" installed;
  2. copy all jars and directories from

    ${eclipse_luna}\plugins
    

    starting with org.eclipse.m2e prefix to

    ${eclipse_mars}\plugins;
    
  3. in

    ${eclipse_mars}\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info
    

    remove all lines starting with org.eclipse.m2e prefix and copy-paste all lines starting with org.eclipse.m2e from

    ${eclipse_luna}\configuration\org.eclipse.equinox.simpleconfigurator\bundles.info
    

Remember not to update "Maven Integration for Eclipse" feature, because it will probably overwrite above changes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!