What Version of Java Are You Runing?

来源:百度文库 编辑:神马文学网 时间:2024/05/17 02:38:11

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

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.
  • As of April 15, 2010, the latest version of Java is 1.6.0_20 (a.k.a Version 6 Update 20)
  • As of April 2, 2010, the latest version of Java is 1.6.0_19 (a.k.a Version 6 Update 19)
  • As of January 14, 2010, the latest version of Java is 1.6.0_18 (a.k.a Version 6 Update 18)
    However Sun still "Recommended" Version 6 Update 17 as of Jan 18, 2010.
    This release is said to offer 350 bug fixes, but closes no security holes.
  • As of November 5, 2009, the latest version of Java is 1.6.0_17 (a.k.a Version 6 Update 17)
  • As of August 11, 2009, the latest version of Java is 1.6.0_16 (a.k.a Version 6 Update 16)
    According to Sun "This feature release does not contain any new fixes for security vulnerabilities..."
  • As of August 3, 2009, the latest version of Java is 1.6.0_15 (a.k.a Version 6 Update 15)
  • As of May 30, 2009, the latest version of Java is 1.6.0_14 (a.k.a Version 6 Update 14)
    According to Sun "This release is Windows 7 support-ready and includes support for Internet
    Explorer 8, Windows Server 2008 SP2, and Windows Vista SP2. New features include the G1 garbage
    collector, plus performance and security enhancements."
    There are also hundreds of bug fixes.
    but, according to Sun, there are no new fixes for security vulnerabilities.
  • As of late March 2009, the latest version of Java is 1.6.0_13 (Version 6 Update 13)
  • As of February 9, 2009 both Sun pages now agree that version 1.6.0_12 is the latest.
    According to the release notes, this version "does not contain any new fixes for
    security vulnerabilities to its previous release, Java SE 6 Update 11."
  • As of Febraruy 3, 2009 there may be a new release of Java.
    The Java SE downloads page shows JRE 6 Update 12 as the latest, but the
    Java Downloads for All Operating Systems page shows Version 6 Update 11 as the latest.
  • As of December 2008, the latest version of Java is 1.6.0_11
  • As of October 2008, the latest version of Java is 1.6.0_10
        See Should you install the new version of Java?
  • As of July 2008, the latest version of Java is 1.6.0_07
  • As of May 2008, the latest version of Java is 1.6.0_06
  • As of March 2008, the latest version of Java is 1.6.0_05
  • In January 2008, version 1.6.0_04 was half-released (blame Sun, not me).
    Version 1.6 update 4 shows up at java.sun.com/javase/downloads/
    but update 3 shows up at java.com/en/download/windows_manual.jsp.
    See Massive Java Update Includes Security Fixes and
    Sun's Java sloppiness for more.
  • As of October 2007, the latest version of Java from Sun was 1.6.0_03
  • As of June 2007, the latest version of Java from Sun was 1.6.0_2.
  • As of March 2007 the latest version of Java from Sun was 1.6.0_1.
  • As of December 2006 the first version of Java 1.6 from Sun was 1.6.0.0.
  Version 1.5.x
  • As of November 3, 2009 version 5 of Java was declared End of Life by Sun
  • During 2009 Java version 5 received updates numbered 18 through 22
  • As of December 2008 the latest version of Java 1.5.x from Sun was 1.5.0_17
  • As of October 2008 the latest version of Java 1.5.x from Sun was 1.5.0_16
  • As of March 2008 the latest version of Java 1.5.x from Sun was 1.5.0_15
  • As of November 2007 the latest version of Java 1.5.x from Sun was 1.5.0_14
  • As of October 2007 the latest version of Java from Sun was 1.5.0_13
  • As of June 2007 the latest version of Java from Sun was 1.5.0_12
  • As of February 2007 the latest version of Java from Sun was 1.5.0_11.
  • As of December 2006 the latest version of Java from Sun was 1.5.0_10.
  • As of October 2006 the latest version of Java from Sun was 1.5.0_09.
  • As of August 2006 the latest version of Java from Sun was 1.5.0_08.
  • As of December 2005 the latest version of Java from Sun was 1.5.0_06.
  • As of October 2005 the latest version of Java from Sun was 1.5.0_05.
  • As of July 2005, the latest version from Sun was 1_5_0_04.
  • As of February 2005 the latest version from Sun was 1_5_0_01.
Java on MacsApple Mac users are often stuck with buggy versions of Java. For whatever reason, Java on the Mac comes from Apple. Java on Windows, Linux and Solaris comes from Sun. Apple is always behind the curve, that is, they are late in releasing the latest versions of Java for the Mac OSX.

December 3, 2009: Apple issued updates to their versions of Java. The latest version of Java for OS X 10.6 Snow Leopard is 1.6.0_17. The latest versions of Java for OS X 10.5 Leopard are 1.6.0_17 and 1.5.0_22. The 1.4.x family of Java has been discontinued.

September 3, 2009: The latest versions of Java for Leopard and Snow Leopard are 1.6.0_15, 1.5.0_20 and 1.4.2_22. Tiger users don't get the latest updates and thus are forced to run dangerous, buggy versions of Java (either 1.5.0_19 or 1.4.2_21).

June 15, 2009: Apple today released a fix for OS X 10.4 and 10.5 to the problem described below. If you are running OS X 10.4 then the safe versions of Java are 1.5.0_19 and 1.4.2_21 (download here). If you are running OS X 10.5, then the safe versions of Java are 1.6.0_13, 1.5.0_19 and 1.4.2_21 ( download here).

May 20, 2009: All Macs running Java are vulnerable to a security problem with Apple's implementation of Java. The only fix was to turn off Java. Macworld has instructions on disabling Java in Safari, Firefox, OmniWeb, Camino, Opera and iCab. More...

As of April 22, 2009, I'm told that the latest version of Java for OS X is 1.6.0_07-b06-153. However, Java 6 is not enabled by default even if it is installed. To switch versions, you need to run the utility Applications/Utilities/Java/Java Preferences.app This allows you to set the preferred order for selection of a JVM (along with various runtime and security options). You can set the order separately for applications and applets. Currently Mac users won't have Java 6 unless they enable it manually this way. (thanks Marcus).

As of February 13, 2009, the latest versions of Java for OS X were Java for Mac OS X 10.4 Release 8 and Java for Mac OS X 10.5 Update 3.
Microsoft JavaIf Internet Explorer is using a JVM from Microsoft, you should replace it with a newer one from Sun. To un-install the Microsoft JVM see the installing page. There is a patch for bugs discovered back in 2005 in the Microsoft JVM (Microsoft Security Advisory (903144) and Secunia Advisory SA15891) but un-installing it is best.

 Method 2: Java command

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.

 Method 3:  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 4:  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.

  • Each ActiveX control has a "code base" and for each of the Java entries above the code base was
    http://java.sun.com/update/1.6.0/jinstall-1_6_0_07-windows-i586.cab
    Finally, a version number. You may feel like Indiana Jones at this point.

  • Each ActiveX control also has a version description. The two entries above with the yellow exclamation points have a version description of "Java(TM) Platform SE binary". But the remaining entry above has a version description of "Java Plug-in 1.6.0_07 for Netscape Navigator (DLL" .
Well, that explains everything.

 

 Method 5:  jview command

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?

 Method 6: The Java Systray Icon

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

 Method 7: 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. 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.

 Method 8:  System Information

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.

 Method 9:  Java Console

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: Microsoft (R) VM for Java, 5.0 Release 5.0.0.3810

On a machine running IE 5.5 SP2 under Windows 2000, the output was:Microsoft (R) VM for Java, 5.0 Release 5.0.0.3802

On a machine running IE 5.01 SP2 under Windows NT4 the output was: Microsoft (R) VM for Java, 5.0 Release 5.0.0.3319

 Method 10: 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 11: Other Java Testers

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