简体   繁体   English

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

[英]How to downgrade JRE/JDK on Mac OSX?

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?有谁知道如何通过终端在 Mac OSX 上将 JRE/JDK 的版本从 1.6.0_24 降级到 1.6.0_18? I need to downgrade in order to get a Java applet working in Firefox.我需要降级才能让 Java 小程序在 Firefox 中运行。 Any help would be much appreciated.任何帮助将非常感激。

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, eg我只是通过查看 /Library/Java/JavaVirtualMachines 并移开具有最高版本号的目录,将 JRE 和编译器从 Java 8 降级到 7,例如

sudo mv jdk1.8.0.jdk ~/Desktop/

That's easy.这很容易。 You have to remove de .jdk directory of the JDK 7 in /Library/Java/JavaVirtualMachines.您必须在 /Library/Java/JavaVirtualMachines 中删除 JDK 7 的 de .jdk 目录。 Now you only have to install the version you like.现在你只需要安装你喜欢的版本。 =) =)

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

If the older JDK isn't on your machine, you'd need to use the GUI and download the Java updater.如果旧的 JDK 不在您的机器上,您需要使用 GUI 并下载 Java 更新程序。 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):我能找到的最接近你的是 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.我没有看到任何 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为此,您可能必须下载每个 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 中更改您机器上的默认 Java。

Hope this helps...希望这可以帮助...

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。

To downgrade your JDK you will need the JDK installation package and an app called Pacifist, available from http://www.charlessoft.com/ .要降级您的 JDK,您将需要 JDK 安装包和一个名为 Pacifist 的应用程序,可从http://www.charlessoft.com/获得。 The usage is pretty straight forward.用法非常简单。 I have used it to downgrade my JDK before.我以前用它来降级我的JDK。

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.这会将 java 指向 java6 中的最后一次更新。 And now update all the paths.现在更新所有路径。

Hope it might be helpful and let me know if it works...:)希望它可能会有所帮助,让我知道它是否有效...... :)

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.我相信只要在编译/运行时指定路径,你就可以在一台机器上拥有多个版本的 jdk/jre。 However, the jvm is bundled with mac which makes this problematic.但是,jvm 与 mac 捆绑在一起,这会造成问题。

This post may be helpful这篇文章可能会有所帮助

How to install a specific JDK on Mac OS X? 如何在 Mac OS X 上安装特定的 JDK?

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.如果您无法在 Firefox 中运行它,请尝试使用 Chrome 或 Safari。 If it is the mixed code issue, then this is changed in the Java Settings panel in Programs -> Utilities in the Advanced panel.如果是混合代码问题,则在“高级”面板的“程序”->“实用程序”的“Java 设置”面板中进行更改。

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.您可以使用 Pacifist 软件打开 JRE 1.6.0_20 映像文件,并将所有带有框架的文件夹解压缩到 \System\Library\Frameworks\JavaVM.framework\Versions 文件夹中。 After that the JRE should appear in your Applications/Utilities/Java Preferences JRE selection menu, where you can switch between the running JRE's.之后,JRE 应该出现在您的 Applications/Utilities/Java Preferences JRE 选择菜单中,您可以在其中切换正在运行的 JRE。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM