See my Defensive Computing blog at Computerworld.com  
What Version of Java Are You Using?

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

 Method 1:  Ask Java

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_30 from Sun Microsystems Inc.   or
Java Version: 1.3.1 from Apple Computer, Inc.   or

  RECENT JAVA VERSIONS
 Version 1.7 (a.k.a Java 7)
  • As of April 27, 2012 the latest version of Java 7 is Update 4.   Download
    According to Oracle: "This release includes bug fixes and performance improvements, including a new JVM, Mac OS X support ... and more!" No security patches.
  • As of February 14, 2012 the latest version of Java 7 is Update 3
    According to Oracle, "This release contains fixes for security vulnerabilities"
  • As of December 13, 2011 the latest version of Java 7 is Update 2
    This release fixes security vulnerabilities.
  • As of October 20, 2011 the latest version of Java 7 is Update 1
  • On July 28, 2011 Oracle released version 7 of Java.
    As of April 2012 it is still not the default for new installs of Java. See why.
 Version 1.6.x (a.k.a Java 6 Update x)
 NOTE: Java 6 is scheduled to die (End of Life or EOL) in November 2012
  • As of April 27, 2012 the latest version of Java 6 is 1.6.0_32 (Version 6 Update 32).   Download
    According to Oracle, "This release includes bug fixes and performance improvements." No security patches.
  • As of February 14, 2012 the latest version of Java 6 is 1.6.0_31 (Version 6 Update 31)
    According to Oracle, "This release contains fixes for security vulnerabilities"
  • As of December 13, 2011 the latest version of Java 6 is 1.6.0_30 (Version 6 Update 30)
    This release fixes many bugs, but no security vulnerabilities.
  • As of October 20, 2011 the latest version of Java 6 is 1.6.0_29 (Version 6 Update 29)
    This release fixes MANY security bugs.
  • As of August 24, 2011 the latest version of Java 6 is 1.6.0_27 (Version 6 Update 27)
    This release fixes many bugs, but NO security bugs.
  • As of June 8, 2011 the latest version of Java 6 is 1.6.0_26 (Version 6 Update 26)
    This release does fix security bugs.
  • As of April 21, 2011 the latest version of Java is 1.6.0_25 (Version 6 Update 25)
    This release adds new features, but does not include any security bug fixes. Among the
    new features are support for Windows 7 with SP1, IE9, Firefox 4, Chrome 10 and VirtualBox 4
  • As of February 17, 2011, the latest version of Java is 1.6.0_24 (a.k.a Version 6 Update 24)
Java on Macs
Oftentimes Apple Mac users have been stuck with old buggy versions of Java. For whatever reason, Java on the Mac comes from Apple. Java on Windows, Linux and Solaris comes from Oracle (previously from Sun). Apple has often been late in releasing the latest versions of Java for OS X leaving Mac users exposed to known flaws. If a Mac user needs Java for an application, they may want to disable it in their browser. If a Mac user needs Java for a website, they may want to disable it in the browser they use most of the time and leave it enabled in another browser used just on the site(s) where Java is required.

How to disable Java in a Mac browser:
SAFARI: Go to Preferences, then Security. There is an "Enable Java" checkbox, turn it off.
CHROME: In the address bar enter "about:plugins" without the quotes. Find the Java plugin (the description is "Java Plug-In 2 for NPAPI Browsers", then click the Disable link.
FIREFOX: Click on Tools, then Add-Ons, then Plugins. Locate the Java Applet plugin and click the Disable button.
How To Disable Java in your Mac Web Browser
Scared Of Flashback? Here’s How To Disable Java On Your Mac And Stay Safe
How to disable the Java web plug-in in Safari from Apple for OS X 10.4, 10.5, 10.6 and Lion

April 3, 2012
Important security updates issued. See More than 600,000 Macs infected with Flashback botnet and Java update for OS X patches Flashback malware exploit. Mac users running OS X 10.5 Leopard should not use Java, because Apple has stopped supporting Java on Leopard. The last version of Java for OS X 10.5 has known bugs that will not be fixed.
Java for Mac OS X 10.6 Update 7 updates Java to 1.6.0_31
Java for Mac OS X 10.7 Lion 2012-001 updates Java to v1.6.0_31

November 8, 2011
Java for Mac OS X 10.6 Update 6 updates Java to v1.6.0_29
Java for Mac OS X 10.7 Lion Update 1 updates Java to v1.6.0_29

March 9, 2011
Java for Mac OS X 10.6 Update 4 updates Java to v1.6.0_24
Java for Mac OS X 10.5 Update 9 updates Java either to v1.5.0_28 or to v1.6.0_24 for 64-bit capable Intel-based Macs.

 Method 2: The Java Systray Icon (Windows)

If the Java coffee cup is displayed in the Windows 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 7 in April 2012).


 Method 3: Windows Control Panel

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. In Windows 7, click on Programs and Features. Note however, that just because Java is installed, does not mean that any particular web browser on your computer is using it.

For Java version 6, the Name column displays a user-friendly "Java (TM) 6 Update 31". This would appear at the top of this page as "1.6.0_31". The version column, under Windows 7, displays this same version information as 6.0.310. Yes, three different formats for the same information. Ugh.

In old days, Java version 1.5.0, looked like: "J2SE Runtime Environment 5.0 Update 6". J2SE meant Java. Runtime Environment refers to the 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. Way back, with Sun's Java version 1.4.2, the Control Panel entry looked like "Java 2 Runtime Environment, SE v1.4.2._06". This meant that version 1.4.2_06 was installed on the computer.

 Method 4: OS X

April 4, 2012: Over at CNET, Topher Kessler describes how to check if Java is installed in OS X 10.6 and 10.7.

"A simple way to see if you have Java installed is to open an application that requires it, and one of these that is included with OS X is the Java Preferences utility. Go to the /Applications/Utilities/ folder in OS X and launch the Java Preferences program, and if it opens and shows various configuration options, then you have Java installed; however, it if shows a message stating you need Java and provides you with an option to install it, then you do not have Java installed."

Apparently he is unaware of this site. To see which version(s) of Java are installed he suggests running the Terminal program (in the /Applications/Utilities/ folder) and issuing the following command:

sudo /usr/libexec/java_home

Another way to learn the Java version was suggested by an undated writeup from California State University. They suggest issuing the

java -version
command in Terminal. This approach is confirmed for OS X 10.6 and 10.7 at Computerworld.com by Gregg Keizer (April 4, 2012) who also reports that if Java is not installed, the error is "No Java runtime support, requesting install".

 Method 5: Java command on Windows

On Windows versions prior to 7, open a command window and enter the following command

java -version

The output will look something like:

java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) Client VM (build 20.6-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"

As of Windows 7, this no longer works. It produces the error shown below, which is also produced on an XP machine without any version of Java from Oracle installed. An XP computer with only Microsoft's ancient version of Java installed, also produces the error below.

'java' is not recognized as an internal or external command, operable program or batch file.

On a Windows machine with multiple versions of Java, according to Sun, this command returns the default JVM.

 Method 6:  Firefox Options

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

 Method 7:  Internet Explorer Options

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.

  1. Why are there three entries?
  2. Why does each entry have two different version numbers?
  3. How can anyone translate any of the displayed version numbers into 1.6.0_07?
  4. Why do the two newer entries have yellow exclamation points?
  5. Why is the Total Size for each zero?
I don't know (repeat five times).

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.

Well, that explains everything.

 Method 8: JavaScript

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]

 Method 9: Other Java Testers

Other Testers page list other Java Testers in addition to testers for Flash, QuickTime, and more.

 Retired:   Java Console

The information here originally dated back to Internet Explorer 5 and 6, so it has been removed. Someday, maybe, I'll update it.

 Retired:   jview command

NOTE: This is very old. Microsoft got out of the JVM business long ago. Information on removing the Microsoft JVM is on the installing page.

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). This was, I believe, the point where Microsoft walked away from Java.

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 was 5.0.3810 and, as of July 2005, the latest version was still 3810. Microsoft Knowledge Base Article - 163637 INFO: Availability of Current Build of Microsoft VM has more on using the jview command.