java JRE 6 和 7 并排,默认 JRE 6 (Win 7)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16892999/
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
JRE 6 and 7 side-by-side with JRE 6 as default (Win 7)
提问by Jaap Coomans
For a migration project to migrate from Java 6 to Java 7 runtime on Windows 7, we are looking to get the following situation:
对于在 Windows 7 上从 Java 6 迁移到 Java 7 运行时的迁移项目,我们希望获得以下情况:
- Both JRE 6 and JRE 7 are installed on the machine
- JRE 6 is set as the default
- JRE 7 will be explicitly requested by applets and webstart applications that require it.
- 机器上安装了JRE 6和JRE 7
- JRE 6 设置为默认值
- JRE 7 将由需要它的小程序和 webstart 应用程序明确请求。
We found lots of solutions that use the path to achieve a situation like this, but we are looking for a way to keep the default path (using the java.exe in C:\Windows\System). Changing the registry key \HKLM\SOFTWARE\Wow6432\JavaSoft\Java Runtime Environment\CurrentVersion to 1.6 does not work unfortunately.
我们找到了很多使用路径来实现这种情况的解决方案,但我们正在寻找一种方法来保留默认路径(使用 C:\Windows\System 中的 java.exe)。不幸的是,将注册表项 \HKLM\SOFTWARE\Wow6432\JavaSoft\Java Runtime Environment\CurrentVersion 更改为 1.6 不起作用。
Does anybody have experience with a setup like this?
有没有人有这样的设置的经验?
Edit:I get a lot of questions WHY we want this. I can discuss all the ins and outs, but please take it from me that we discussed all possible scenario's and this is the one that impacts our business the least. There are more than 10K systems (laptop + desktop) involved and lots of different Applets, webstart applications and standalone client applications involved.
编辑:我有很多问题为什么我们想要这个。我可以讨论所有的来龙去脉,但请相信我,我们讨论了所有可能的情况,这是对我们业务影响最小的情况。涉及超过 10K 个系统(笔记本电脑 + 台式机),涉及许多不同的 Applet、webstart 应用程序和独立客户端应用程序。
采纳答案by Jaap Coomans
Unfortunately the answer for Applets and web start is that this is not possible (anymore). As can be found in the JRE installer options page of Oracle, the latest JRE is chosen by the browser plugin by default:
不幸的是,Applets 和 web start 的答案是这是不可能的(不再)。可以在Oracle的JRE 安装程序选项页面中找到,默认情况下浏览器插件会选择最新的 JRE:
Beginning in Java SE 6 update 10 release, the latest JRE software will be registered with all browsers. This ensures that applets will run on the latest and most secure version of the JRE software.
从 Java SE 6 update 10 版本开始,最新的 JRE 软件将注册到所有浏览器。这确保了小程序将在最新和最安全的 JRE 软件版本上运行。
Some solutions can be found that suggest changing several registry keys, but these only work for versions prior to 1.6.0 update 10. As soon you install this or a newer version, those registry keys are ignored.
可以找到一些建议更改多个注册表项的解决方案,但这些仅适用于 1.6.0 update 10 之前的版本。安装此版本或更新版本后,这些注册表项将被忽略。
We are still awaiting a formal response from Oracle, but we do not expect a different outcome.
我们仍在等待 Oracle 的正式回复,但我们预计不会有不同的结果。
回答by Anooshiravan Ahmadi
回答by user2859716
I had a problem that was nearly the same as yours, I wanted to use jre 6 to run an old version of sgd (sun secure global desktop). My walkaround for this :
我遇到了与您几乎相同的问题,我想使用 jre 6 来运行旧版本的 sgd(太阳安全全局桌面)。我的解决方法:
- Get firefox portable
- about:config --> plugin.scan.plid.all = false (don't know if it's necessary)
- Add jre portable version 6 to the folder (plugins)
- Go to the Java Control Panel (in Windows Control Panel) --> Java tab --> View.. (Visualiser in french) --> Uncheck 1.7
- 获取 Firefox 便携版
- about:config --> plugin.scan.plid.all = false(不知道有没有必要)
- 将 jre 便携版 6 添加到文件夹中(插件)
- 转到 Java 控制面板(在 Windows 控制面板中)--> Java 选项卡--> 查看..(法语中的 Visualiser)--> 取消选中 1.7
May be just the last step will work for you...
可能只是最后一步对你有用......
Hope this will help someone.
希望这会帮助某人。
回答by Stephen C
I think that the answer is that there probably isn't a way to do that which is going to work for all of your existing menagerie of in-house and 3rd-party applications ... and their various ways of locating their Java platform.
我认为答案是,可能没有一种方法可以对所有现有的内部和 3rd 方应用程序...以及它们定位 Java 平台的各种方法都有效。
And if you get something that works "most of the time" then there is a good chance that the breakage in the other cases will be worse than if you had taken a more aggressive approach to conversion.
如果你得到的东西“大部分时间”都有效,那么在其他情况下的破损很可能会比你采取更积极的转换方法更糟。
The root problem here is in-house and 3rd-party stuff making unwarranted (and probably unnecessary) assumptions about the Java platform they are running on. If the application can't be fixed to get it to work on Java 7, it probably should be ditched ... or quarantined in a heavily fire-walled virtual machine or something. Java 6 has been EOL'ed. So unless your organization is prepared to pay big bucks for support from Oracle you won't get any more security patches. IMO, that is good enough reason to boot it out of your supported / allowed COEs ... whether the users like it or not.
这里的根本问题是内部和 3rd 方的东西对他们正在运行的 Java 平台做出了毫无根据(并且可能是不必要的)假设。如果应用程序无法修复以使其在 Java 7 上运行,它可能应该被抛弃……或者隔离在一个防火墙很严密的虚拟机或其他东西中。Java 6 已停产。因此,除非您的组织准备为 Oracle 的支持支付大笔费用,否则您将无法获得更多安全补丁。IMO,这是从您支持/允许的 COE 中启动它的充分理由……无论用户喜欢与否。
It is all very well to say that there is politics in the problem. But if push comes to shove, >>you<< guys will get the blame if your "gently, gently" approach fails technically and you get security problems due to running unpatched / unpatchable Java installations.
可以说问题中存在问题。但是,如果迫在眉睫,如果您的“轻轻地、温和地”方法在技术上失败并且由于运行未打补丁/不可打补丁的 Java 安装而遇到安全问题,那么 >> 你们<< 伙计们将受到指责。