mac系统一般默认会安装jdk 1.6,路径为/System/Library/Java/JavaVirtualMachines/1.6.0.jdk,此Jdk为系统默认jdk;

但某些框架/应用要求jdk1.7甚至jdk1.8才能运行,所以需要配置系统默认jdk。

首先下载并安装需要的jdk,http://www.oracle.com/technetwork/java/javase/downloads/index.html

配置方式为 vim ~/.bash_profile

增加或修改

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home

最后重新加载profile

source ~/.bash_profile

相关文章:

  • 2021-10-21
  • 2021-11-09
  • 2021-12-30
  • 2022-02-12
  • 2022-12-23
  • 2021-06-25
  • 2021-05-20
  • 2021-12-05
猜你喜欢
  • 2021-11-04
  • 2021-09-27
  • 2021-08-29
  • 2022-01-07
  • 2021-12-27
  • 2021-07-23
  • 2021-10-17
相关资源
相似解决方案