Java 如何在 Mac OSX 上降级 JRE/JDK?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6411909/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-16 05:44:29  来源:igfitidea点击:

How to downgrade JRE/JDK on Mac OSX?

macosjava

提问by jrutter

Does anyone know how to downgrade the version for JRE/JDK from 1.6.0_24 to 1.6.0_18 on a Mac OSX thru Terminal? I need to downgrade in order to get a Java applet working in Firefox. Any help would be much appreciated.

有谁知道如何在 Mac OSX 上通过终端将 JRE/JDK 的版本从 1.6.0_24 降级到 1.6.0_18?我需要降级才能让 Java 小程序在 Firefox 中工作。任何帮助将非常感激。

采纳答案by Eric

If the older JDK isn't on your machine, you'd need to use the GUI and download the Java updater. The one closest to yours I could find was for Java 1.6.0_15 for Mac OS 10.5 (you didn't mention which Mac OS X version you were running):

如果旧版 JDK 不在您的机器上,您需要使用 GUI 并下载 Java 更新程序。我能找到的最接近你的是 Java 1.6.0_15 for Mac OS 10.5(你没有提到你运行的是哪个 Mac OS X 版本):

Java for Mac OS X 10.5 Update 5

适用于 Mac OS X 10.5 更新 5 的 Java

I didn't see any for Mac OS X 10.6. For that, you would probably have to download the updaters for each 10.6 release, and extract the JDK installer from the updater (using something like Pacifist

我没有看到 Mac OS X 10.6 的任何内容。为此,您可能必须为每个 10.6 版本下载更新程序,并从更新程序中提取 JDK 安装程序(使用类似Pacifist

Oh, and if you haven't already, try running /Applications/Utilities/Java Preferences.app, which lets you change the default Java on your machine amongst the ones you have installed.

哦,如果您还没有,请尝试运行 /Applications/Utilities/Java Preferences.app,它可以让您在已安装的机器中更改机器上的默认 Java。

Hope this helps...

希望这可以帮助...

回答by Thorbj?rn Ravn Andersen

There is no downgrade mechanism for what you want to do.

您要执行的操作没有降级机制。

The typical suggestion is to roll back to the version you want either through Time Machine or by reinstalling and only update selectively to the version you need by downloading explicitly from Apple and not updating Java through software update.

典型的建议是通过 Time Machine 或通过重新安装回滚到您想要的版本,并且仅通过从 Apple 明确下载而不是通过软件更新来更新 Java 来选择性地更新到您需要的版本。

I'd recommend you look into the problem instead. If you cannot run this in Firefox, then try with Chrome or Safari. If it is the mixed code issue, then this is changed in the Java Settings panel in Programs -> Utilities in the Advanced panel.

我建议您改为查看问题。如果您无法在 Firefox 中运行它,请尝试使用 Chrome 或 Safari。如果是混合代码问题,则在“高级”面板中的“程序”->“实用程序”中的“Java 设置”面板中进行更改。

回答by Stefan

To downgrade your JDK you will need the JDK installation package and an app called Pacifist, available from http://www.charlessoft.com/. The usage is pretty straight forward. I have used it to downgrade my JDK before.

要降级您的 JDK,您需要 JDK 安装包和一个名为 Pacifist 的应用程序,可从http://www.charlessoft.com/ 获得。用法非常简单。我以前用它来降级我的JDK。

回答by JJRutter

Which version of firefox are you running?

你运行的是哪个版本的火狐?

I believe you can have more than one version of jdk/jre on a machine as long as you specify the path when compiling/running. However, the jvm is bundled with mac which makes this problematic.

我相信只要在编译/运行时指定路径,您就可以在一台机器上拥有多个版本的jdk/jre。但是,jvm 与 mac 捆绑在一起,这使得这有问题。

This post may be helpful

这篇文章可能有帮助

How to install a specific JDK on Mac OS X?

如何在 Mac OS X 上安装特定的 JDK?

回答by TomaszRykala

I've had the very same problem. You can open the JRE 1.6.0_20 image file with Pacifist software and extract all the folders with the framework into the \System\Library\Frameworks\JavaVM.framework\Versions folders. After that the JRE should appear in your Applications/Utilities/Java Preferences JRE selection menu, where you can switch between the running JRE's.

我遇到了同样的问题。可以用Pacifist软件打开JRE 1.6.0_20镜像文件,将所有包含框架的文件夹解压到\System\Library\Frameworks\JavaVM.framework\Versions文件夹中。之后 JRE 应该出现在您的应用程序/实用程序/Java 首选项 JRE 选择菜单中,您可以在其中切换正在运行的 JRE。

回答by David

That's easy. You have to remove de .jdk directory of the JDK 7 in /Library/Java/JavaVirtualMachines. Now you only have to install the version you like. =)

这很容易。您必须删除 /Library/Java/JavaVirtualMachines 中 JDK 7 的 de .jdk 目录。现在你只需要安装你喜欢的版本。=)

More info: http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html#uninstall

更多信息:http: //docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html#uninstall

回答by Johannes Ernst

That does not seem to be accurate any more.

这似乎不再准确了。

I just managed to downgrade both JRE and compiler from Java 8 to 7 by looking into /Library/Java/JavaVirtualMachines, and moving away the directory with the highest version number, e.g.

我只是通过查看 /Library/Java/JavaVirtualMachines 并移开版本号最高的目录,设法将 JRE 和编译器从 Java 8 降级到 7,例如

sudo mv jdk1.8.0.jdk ~/Desktop/

回答by Avi

These days MAC OS comes with latest java version(8 or later).

如今,MAC OS 带有最新的 Java 版本(8 或更高版本)。

Even if you install the old versions, it points to the Newest version. All it need is just pointing to the old version. To downgrade to any version that is preinstalled is to create a symlink of that version.

即使您安装旧版本,它也指向最新版本。它所需要的只是指向旧版本。降级到预安装的任何版本就是创建该版本的符号链接。

Follow these simple steps to downgrade your java version.

请按照以下简单步骤降级您的 Java 版本。

   (1) cd /System/Library/Frameworks/JavaVM.framework/Versions

   (2) sudo bash

   (3) rm Current

   (4) ln -s 1.6.0/Contents/ Current

   (5) java -version

This will point the java to last update in java6. And now update all the paths.

这会将 java 指向 java6 中的最后更新。现在更新所有路径。

Hope it might be helpful and let me know if it works...:)

希望它可能会有所帮助,并让我知道它是否有效...:)

回答by Randy

I removed the JavaAppletPlugin: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin

我删除了 JavaAppletPlugin: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin

and all 1.8 JDKs: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk

和所有 1.8 JDK:/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk

Then I was able to re-install 1.7.

然后我能够重新安装1.7。