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. Method 1: Ask JavaThis 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.
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.). 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.
Java on Macs
Apple 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 Java
If 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 commandIn 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" 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. (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 OptionsAdvanced 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. Java Plug-in 1.6.0_07 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: This takes you to the folder where the ActiveX controls live. In Windows XP (for both IE6 and IE7) it is: 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.
Method 5: jview commandFor 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 IconIf 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 PanelJava, 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 InformationIn 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: 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 ConsoleFor 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 An old example: Java(TM) Plug-in: Version 1.4.2_04 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: 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: JavaScriptMarch 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:///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.' 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 TestersThe Other Testers page list other Java Testers in addition to testers for Flash, QuickTime, and more. |
|
來(lái)自: king9413 > 《windows維護(hù)》