简体   繁体   中英

Change java version used by java applets in browser

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.

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).

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).

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 )

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.

OS: Windows 7 Enterprise

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

Reference Java Control Panel

Java

The Java panel looks like this:

在此处输入图片说明

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

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

在此处输入图片说明

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:

  • Platform: The version of the Java Runtime Environment
  • Product: The full version number of the Java Runtime Environment (which includes the update number)
  • Location: The URL that Java Update Scheduler uses to launch automatic updates
  • Path: The full path name of the Java Runtime Environment
  • Runtime Parameters: Optional custom options used to override the Java Plug-in default startup parameters
  • Enabled: This option is for selecting which of the (older) JRE versions to consider when running an app using Java Plug-in or Java Web Start. If this check box is not selected, then Java Plug-in and Java Web Start will not use this JRE to launch Java apps. However, the current JRE might be used regardless of this checkbox. This checkbox does not affect stand alone applications, it is only for Java in the browser. Note that if all Java apps are disabled from running in the browser, by de-selecting Enable the Java content in the browser in the Security panel, enabling the JRE here has no effect.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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