如何在Mac上安装Java 8

て烟熏妆下的殇ゞ 提交于 2020-08-08 14:20:24

问题:

I want to do some programming with the latest JavaFX, which requires Java 8. I'm using IntelliJ 13 CE and Mac OS X 9 Mavericks. 我想使用需要Java 8的最新JavaFX进行一些编程。我正在使用IntelliJ 13 CE和Mac OS X 9 Mavericks。 I ran Oracle's Java 8 installer, and the files look like they ended up at 我运行了Oracle的Java 8安装程序,文件看起来像最终在

/Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk

but previous versions are at 但以前的版本在

/System/Library/Java/JavaFrameworks/jdk1.6....

Not sure why the latest installer puts this in /Library instead of /System/Library (nor what the difference is). 不知道为什么最新的安装程序会将它放在/Library而不是/System/Library (也不会有什么区别)。 But /usr/libexec/java_home doesn't find 1.8, so all the posts I've found on how to set your current java version don't work. 但是/usr/libexec/java_home找不到1.8,所以我找到的有关如何设置当前Java版本的所有帖子都不起作用。 I've tried adding a symbolic link to make it look like 1.8 is in the /System/Library... path, but it doesn't help. 我尝试添加一个符号链接,使其看起来像/System/Library...路径中的1.8,但它没有帮助。 /usr/libexec/java_home -V still only lists the old Java 1.6. /usr/libexec/java_home -V仍然仅列出旧的Java 1.6。

Ironically, the "Java" control panel under System Preferences shows only Java 1.8! 具有讽刺意味的是,“系统偏好设置”下的“ Java”控制面板仅显示Java 1.8!

Why doesn't Oracle's installer put it where it really goes? 为什么Oracle的安装程序没有将它放到真正的位置? And how can I work around this problem? 我该如何解决这个问题?


解决方案:

参考一: https://stackoom.com/question/1e8hC/如何在Mac上安装Java
参考二: https://oldbug.net/q/1e8hC/How-to-install-Java-8-on-Mac
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!