Multiple copies of Java can be installed on a single computer, and, if you have more than one web browser, each one can use a different version of Java, or none at all, so be sure to test them all. Below are nine ways to determine the version of Java a web browser is using.
Note: The portion of Java that runs programs is referred to as the Java Virtual Machine (JVM) or Java Run-time Environment (JRE).
This is my favorite - straight from the horse's mouth (so to speak). The Java Run-time Environment is aware of its version and the company that authored it. So I wrote a very simple applet (the source code is on the About page) that gets this information from the JRE and displays it in a pink rectangle.
The version and vendor from the JRE |
If Java is working, you will see a pink rectangle above with one line of text that says something like: Java Version 1.6.0_16 from Sun Microsystems Inc. or |
Troubleshooting: If you don't see a pink rectangle above, Java may not be installed. Or ZoneAlarm may be blocking the Java applet/program that displays the pink rectangle. Zone Alarm has a Mobile Code Control feature that, if set to "Custom", requires you to first enable mobile code from this web site (www.javatester.org). Mac users that find that Safari isn't launching Java should see the Safari Java broken forum posting at Macoshints.com regarding the "Open with Rosetta" option (thanks Eliot). In addition, your web browser may have Java disabled. See sample results.
RECENT JAVA VERSIONS |
Version 1.6.x. |
|
Version 1.5.x |
|
In Windows, open a DOS prompt (a.k.a command window) and enter the following command
java -version
The output will look something like:
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
You can also use the command "java -fullversion" and produce output such as:
java full version "1.6.0_17-b04"
On a computer without any version of Java from Sun Microsystems installed, this results in an error message:
'java' is not recognized as an internal or external command, operable program or batch file.
A computer with only Microsoft's ancient version of Java installed, also produces the above error.
On a Windows machine with multiple versions of Java, according to Sun, this command returns the default JVM.
(1) Mozilla has a plugin check (shown below) that seems to detect Java correctly and report on whether its old or not. See a larger screen shot in this window or a new window.
(2) In Firefox version 3, do Tools -> Options -> Main tab -> Manage Add-ons button -> Plug-ins tab.
The screen shot below shows this from Firefox 3.08 on a Windows XP machine.
(3) In Firefox 3, go to the address bar and enter:
about:plugins
If Java is installed there will be multiple Java entries. In Firefox 3 (at least on Windows XP) they are labeled "Java(TM) Platform SE x Ux" where the Xs represent version numbers. Back with Firefox 2 they were labeled either "Java (TM) Platform" or "Java Plug-in" (last verified with v 2.0.0.12).
On a Windows XP machine with Java version 1.6.0_03 installed, there were seven Java entries, all labelled "Java(TM) Platform SE 6 U3" which translates to Version 6, Update 3.
Back with version 1 of Firefox, the many Java entries showed different versions of Java. For more on how this used to work, see Multi-Version Support from Sun.
Advanced Options Tab
In Internet Explorer 6 and 7 do: Tools => Internet Options => Advanced tab and scroll down to about the middle of the options list. If a version of Java from Sun is installed, there will be a section in this list called "Java (Sun)". If Microsoft's Java is installed, there will be a section in this list called "Microsoft VM". If you see both, as the screen shot below (IE7 on Windows XP SP3) illustrates, then IE is using the one that is checked.
Sun Java Console
If a version of Sun's Java is installed, then do: Tools => Sun Java Console. In both IE6 and IE7 this opens a new window that says "Java console" in the blue stripe at the top of the window. The first two lines of the window display the version of Sun's Java, a sample is shown below. JRE means Java Runtime Environment.
NOTE: Sometime between Java 1.6.0_07 and 1.6.0_13 Internet Explorer 7 lost the Sun Java Console option under Tools on the menu bar (at least under Windows XP). The Java console is available by right clicking on the Java icon in the system tray/notification area.
Java Plug-in 1.6.0_07
Using JRE version 1.6.0_07 Java HotSpot(TM) Client VM
Three ActiveX Controls
Another IE specific approach is to check the version of the ActiveX control/program that implements Java.
With Internet Explorer 7 do:
Tools => Internet Options => General tab => Browsing History Settings button => View Objects button
With Internet Explorer 6 do:
Tools => Internet Options => General tab => Settings button => View Objects button
This takes you to the folder where the ActiveX controls live. In Windows XP (for both IE6 and IE7) it is:
C:\Windows\Downloaded Program Files
At this point it gets messy.
The screen shot above is from IE7 on a Windows XP SP2 machine running Java 1.6.0_07.
You can right click on an ActiveX control and get its properties. For the most part, the properties display mirrors what you see above with two exceptions.
For the Microsoft JVM, you can get information from the jview command when entered at a DOS prompt. If you receive an error that no program by that name exists, then there is no Microsoft JVM on your computer. If output is displayed, the first line will look something like this:
Microsoft (R) Command-line Loader for Java Version 5.00.3802
Microsoft confuses things in that there are two "versions" at play here. The jview command displays the version of the Microsoft JVM which is independent of the version of Java that it implements (1.1.4). Microsoft may upgrade their JVM to fix bugs in the future, and this may result in a new version of their JVM, but it will still implement the ancient Java version 1.1.4.
Versions of the Microsoft JVM are identified by build numbers. The first line of the jview output has a version number in x.yy.zzzz format. The final four digits (zzzz) are the version number. On a fairly untouched Windows 98 SE machine, the version was 5.00.3167. As of November 2002, the latest version of the Microsoft JVM was 5.00.3805 (see Scot Finnie's newsletter, October 11, 2002). By December 2002, the latest version was 5.00.3809. As of April 2003, the latest version is 5.0.3810 and, as of July 2005, the latest version is still 3810. Microsoft Knowledge Base Article - 163637 INFO: Availability of Current Build of Microsoft VM has more on using the jview command.
Even if Microsoft's JVM is installed on your computer, your web browser may use a different JVM. Sun Microsystems describes another way to test for the presence of the Microsoft JVM. See How do I uninstall Microsoft Virtual Machine?
If the Java coffee cup is displayed in the System Tray (a.k.a Notification area) you can right click on it, select "About Java Technology" and get a display that looks like the one shown here (from Windows XP).
Java, like any normal Windows application, shows up in the list of installed programs in the Control Panel. In Windows XP, select Add or Remove Programs. Note however, that just because Sun's Java is installed, does not mean that any particular web browser on your computer is using it.
How Java appears here has varied over time.
Back with Sun's Java version 1.4.2, the entry here looked like "Java 2 Runtime Environment, SE v1.4.2._06". This meant that version 1.4.2_06 was installed on the computer.
Sun's Java version 1.5.0, looked like: "J2SE Runtime Environment 5.0 Update 6". J2SE means Java. Runtime Environment means JVM (Java Virtual Machine). 5.0 meant 1.5.0. Update 6 refered to the version of version 1.5.0. In English, it meant Java version 1.5.0_06.
As of Java version 6, the name displayed here has been made more user-friendly. Specifically, the two useless numbers have been dropped. What Sun refers to as Java 6 Update 17, appears in the list of installed Windows applications as "Java (TM) 6 Update 17". This same version, however, would appear at the top of this page as "1.6.0_17" with the legacy "1" restored in the front and the useless zero in the middle. See a screen shot from March 2010 of how Java 6 Update 17 appears on a Windows XP machine. As this shows, if you click on the "click here for support information link" the version number is displayed in yet another format, as version 6.0.170. You can't make this stuff up.
In some flavors of Windows, the System Information utility includes information about Internet Explorer. Among the data displayed is information on the Java Virtual Machine.
In Windows 2000 you run the System Information utility with:
Start -> Programs -> Accessories -> System Tools -> System Information
Double Click on Internet Explorer in the left hand column, then click on Summary. The Java VM version is displayed. It is similar to the output from the jview command, but not exactly the same. On one computer jview displayed 5.00.3809 while the System Information utility displayed 5.0.3809.0.
The path to the System Information utility is the same in Windows XP as in Windows 2000. However, XP does not display Java version information (at least XP Home Edition SP1 does not).
In Windows 98SE, the path to the System Information utility is also the same as with Windows 2000. I ran it on two Windows 98SE machines. With a recent version of IE5, System Information included Internet Explorer information. With an old version of IE (5.00.2614.3500) it did not.
For Internet Explorer v6 using Sun's Java:
Enable the Java console with Tools => Sun Java Console. When the Java Console pops up, the version number is at the top.
A recent example:
Java Plug-in 1.5.0_10
Using JRE version 1.5.0_10 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\youruserid
An old example:
Java(TM) Plug-in: Version 1.4.2_04
Using JRE version 1.4.2_04 Java HotSpot(TM) Client VM
Additional details, such as the Home Directory where the JVM is installed, are provided by typing "S" for System Properties.
When IE5 and IE6 are using Microsoft's Java, you can add the Java console to the View menu by:
Tools => Internet Options => Advanced tab => Scroll down to the Microsoft VM section
Then turn on the checkbox for Java console enabled.
Enabling the Java console requires a restart of IE, not of Windows.
After enabling the Java console, select View => Java Console. This opens a new window, the first line of which, has information on the JVM version. This appears to be the same information reported by the jview command. Note however that the Java Console will also appear as an option when you select "View" in Windows Explorer.
On a machine running IE 6 with all patches applied as of December 2003 under Windows 2000 the output was:
On a machine running IE 5.5 SP2 under Windows 2000, the output was:
On a machine running IE 5.01 SP2 under Windows NT4 the output was:
March 2010: This JavaScript based approach was offered by Malcolm at nuearth dot com. Sun provides a 16k JavaScript file with handy functions, one of which will test the version of Java installed.See their advice on using the script. DeployJava usage is described in the deployment toolkit script. The following sample script will check and see if the proper version of Java is installed and will display a message if not.
-- In Head----[script src="http://java.com/js/deployJava.js"][/script]---In Bbody-----[div id="dynamiccontent" ][/div][script type="text/javascript"]deployJava.do_initialize();var java_message ='Products XYZ requires Java 7 or higher. Download from www.java.com'function altercontent(){if( deployJava.versionCheck("1.7")==false ){ if (document.all) {dynamiccontent.innerHTML=java_message;}else if (document.getElementById){rng = document.createRange();el = document.getElementById("dynamiccontent");rng.setStartBefore(el);htmlFrag = rng.createContextualFragment(java_message);while (el.hasChildNodes()) { el.removeChild(el.lastChild); }el.appendChild(htmlFrag);}}}window.onload=altercontent[/script]
The Other Testers page list other Java Testers in addition to testers for Flash, QuickTime, and more.