macos – 如何在OS X 10.8(Mountain Lion)中获取Java 6?
作者:互联网
OS X 10.8 removed Java 6和Java Utilities switcher并使Java 7成为default jre,这对像我这样专门研究Java 6的工程师来说很难.我如何找回Java 6?注意:我试过谷歌,但许多假设solutions are outdated.
解决方法:
我找到的最简单的解决方案是
> Download the jdk6(下载按钮位于右上角)
>将其打包到某个地方.最好是/System/Library/Frameworks/JavaVM.framework/Versions/1.6.这就是我看起来的样子:
> ls /System/Library/Frameworks/JavaVM.framework/Versions/1.6
Classes Commands Home Info.plist Libraries MacOS Resources version.plist
>通过在〜/ .bashrc(或〜/ .zschrc)文件中导出$PATH之前导出JAVA_HOME = / System / Library / Frameworks / JavaVM.framework / Versions / 1.6 / Home /,将$JAVA_HOME设置为新位置
>通过执行此导出PATH = $JAVA_HOME / bin:/usr/bin:/ bin:/ us ……….将$JAVA_HOME添加到$PATH.
>重新启动shell或执行源〜/ .bashrc
标签:java,macos,mountain-lion 来源: https://codeday.me/bug/20190818/1687336.html