Why Maven uses JDK 1.6 but my java -version is 1.7

前端 未结 9 2095
一个人的身影
一个人的身影 2020-11-28 18:01

I\'m new to maven, and also to MacOS.

I have setup maven in my terminal, and when getting the version settings (using mvn -v) it seems it uses JDK 1.6,

9条回答
  •  一向
    一向 (楼主)
    2020-11-28 18:40

    Please check the compatibility. I struggled with mvn 3.2.1 and jdk 1.6.0_37 for many hours. All variables were set but was not working. Finally I upgraded jdk to 1.8.0_60 and mvn 3.3.3 and that worked. Environment Variables as following:

    JAVA_HOME=C:\ProgramFiles\Java\jdk1.8.0_60 
    MVN_HOME=C:\ProgramFiles\apache-maven\apache-maven-3.3.3 
    M2=%MVN_HOME%\bin extend system level Path- ;%M2%;%JAVA_HOME%\bin;
    

提交回复
热议问题