更改浏览器中 Java 小程序使用的 Java 版本 [英] Change java version used by java applets in browser

查看:52
本文介绍了更改浏览器中 Java 小程序使用的 Java 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在具有 Java 小程序的站点上使用 selenium 进行一些自动化测试.具体来说,我想在不同的浏览器上测试不同的java版本.

I am trying to do some automated testing with selenium on a site that has a java applet. Specifically, I want to test different java versions on different browsers.

更改本地应用程序/命令行正在使用的 jre 相对容易 - 通常只是修改 PATH 并且可能是注册表调整(HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Runtime Environment/CurrentVersion 似乎需要有时会改变).

It is relatively easy to change the jre that is being used by local applications/commandline - usually just a modification of the PATH and perhaps a registry tweak (HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java Runtime Environment/CurrentVersion seems to need to be changed sometimes).

但我似乎无法更改浏览器小程序使用的内容.我的理解是这个版本是由那个浏览器的插件决定的.我试图通过实际卸载机器上的所有 jre,然后安装我想要测试的特定版本来解决这个问题.但是,我需要 Java 始终可用,因此我保留了 jdk (1.8.0_25).

But I can't seem to manage to change what a browser applet uses. It is my understanding that this version is determined by the plugin for that browser. I've tried to get around this by actually uninstalling all the jre on the machine, then installing the specific version I want to test. However, I need java to be available at all times so I am preserving a jdk (1.8.0_25).

这有时有效.最近我一直在尝试安装 jre7(更新 71 和更新 72),但是这两种安装似乎都不会影响小程序中使用的 java 版本.在 firefox 中,附加组件页面在插件下显示 Java (TM) Platform SE 7 U72 10.72.2.14,但它在小程序中运行 1.8.0_25(来自 1.8.0_25a href="http://javatester.org/version.html" rel="nofollow">http://javatester.org/version.html)

This works, sometimes. Recently I've been trying to install jre7 (update 71 and update 72) but neither installation seems to affect the version of java used in the applet. In firefox, the add-ons page shows Java (TM) Platform SE 7 U72 10.72.2.14 under plugins, and yet it is running 1.8.0_25 in applets (from http://javatester.org/version.html)

我的问题是:如何确保特定版本的 java 在浏览器小程序中运行?对不起,如果我的情况有点混乱 - 我已经尝试将其减少到最低限度.

My question is: how can I ensure that a specific version of java is running in browser applets? Sorry if my situation is a bit confusing - I've tried cutting it down to the bare minimum.

操作系统:Windows 7 企业版

OS: Windows 7 Enterprise

浏览器:Chrome 39.0.2171.71 m、FF35.0、33.0、27.0、IE8

Browsers: Chrome 39.0.2171.71 m, FF35.0, 33.0, 27.0, IE8

推荐答案

参考 Java 控制面板

Java

Java 面板如下所示:

The Java panel looks like this:

单击查看..."按钮访问 Java 运行时环境设置对话框.Java 运行时环境设置

Click the View... button to access the Java Runtime Environment Settings dialog. Java Runtime Environment Settings

这些设置将在 Java 应用程序启动时使用.这Java 运行时环境设置对话框如下所示微软视窗:

These settings will be used when a Java application is launched. The Java Runtime Environment Settings dialog looks like the following on Microsoft Windows:

Java 运行时版本面板中的每一行代表一个 Java 运行时安装在您的计算机中的环境.您可以修改双击每个单元格中的值:

Each row in the Java Runtime Versions panel represents a Java Runtime Environment that is installed in your computer. You may modify the value in each cell by double-clicking it:

  • 平台:Java 运行时环境的版本
  • 产品:Java 运行时环境的完整版本号(包括更新号)
  • 位置:Java Update Scheduler 用于启动自动更新的 URL
  • Path:Java 运行时环境的完整路径名
  • 运行时参数:用于覆盖 Java 插件默认启动参数的可选自定义选项
  • 已启用:此选项用于选择在使用 Java Plug-in 或 Java 运行应用程序时要考虑的(旧)JRE 版本网络启动.如果未选中此复选框,则 Java Plug-in 和Java Web Start 不会使用此 JRE 来启动 Java 应用程序.然而无论此复选框如何,都可能使用当前的 JRE.这个复选框不影响独立应用程序,它仅适用于 Java 中的浏览器.请注意,如果所有 Java 应用程序都被禁止在浏览器,通过取消选择在浏览器中启用 Java 内容安全面板,在此处启用 JRE 无效.

使用 Enabled 复选框来选择在使用 Java Plug-in 或 Java Web Start 运行应用程序时要使用的 JRE.

Use the Enabled checkbox to select which JRE to use when running an app using Java Plug-in or Java Web Start.

这篇关于更改浏览器中 Java 小程序使用的 Java 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆