1

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

1 Answer 1

2

Reference Java Control Panel

Java

The Java panel looks like this:

enter image description here

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:

enter image description here

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the detailed reply - however I have encountered this solution before and it didn't really work for me. I have 1.8.0_25 and 1.7.0_72 runtime environments installed, as well as the 1.8.0_25 jdk. In the Java Runtime Environment Settings dialog I have 1.8 and 1.7 as options (as expected). When I untick the 1.8 option and start Firefox (27.0) then visit http://javatester.org/version.html, it still shows 1.8.0_25 and the 1.8 option actually becomes re-ticked by itself.
To clarify - the option remains unticked (as I set it) until I actually visit the webpage and run the applet, upon which it reticks itself.
Hello, I have tried this and even untick the higher java version (1.8) but still failed to open the applet. Because the applet can comply only with Java 1.6. Is there anything I need to do?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.