See my new Defensive Computing blog at CNET.com  
About This Web Site

When I was learning Java, it was annoying that there was no simple easy way to determine which version of Java was being used by a web browser. At the time Microsoft was distributing its own JVM. As they are no longer doing so, the issue expanded into whether Java is even installed at all. Thus, this web site. 

This web site does not address stand-alone Java programs that run outside the scope of a web browser and a web page. That's another story.  So too is the JDK (Java Developers Kit) which is only of interest to Java programmers.

This web site is not associated with Sun Microsystems.   

 How The Java Version Display Applet Works

Java programs run under the control of a Java Virtual Machine. The JVM is aware of both its vendor and version. There is a Java function call (aka "method") that returns this information to a Java program. The pink box displayed in Method 1 is logically owned by a Java applet. That is, all the pixels in the pink box are displayed by a simple Java applet that I wrote. This applet gets the current JVM version and the name of the company that created the JVM and displays it. The full source code of this applet is shown below. 

 import java.applet.*;
 import java.awt.*;
 public class JavaVersionDisplayApplet extends Applet
 { private Label m_labVersionVendor; 
   public JavaVersionDisplayApplet() //constructor
   { Color colFrameBackground = Color.pink;
     this.setBackground(colFrameBackground);
     m_labVersionVendor = new Label (" Java Version: " +
                                    System.getProperty("java.version")+
                           " from "+System.getProperty("java.vendor"));
     this.add(m_labVersionVendor);
   }
 }

NOTE: Web developers using Front Page may find that IE uses different versions of Java at different times. That is, a standalone version of IE may use Sun's version of Java while a web page displayed using Front Page's Preview feature may use Microsoft's Java. 

NOTE: A few people have re-compiled the source code above and found that it no longer works the same. When compiled with a 2005 version of Java from Sun (and maybe 2004 too) it chokes on copies of IE with the Microsoft JVM. One reader of this site said the following compile options fixed this problem: 
       javac -O -target 1.1 -source 1.2 javafilename

For more on this see Java Troubleshooting by Brian Cryer who says the problem may be a mismatch between the version of Java the applet was created with and the version on the users machine. He suggests compiling with: 
         Javac xxxx.java -target 1.1
Where 1.1 is the release of the Java VM you wish the .class file to work on. 
  

 Techie Stuff

In June 2007 the site was made printer friendly. That is, each page automatically gets modified to a printer friendly format when it's printed. Thanks to CSS.

Design: For HTML folks, this web site is dependant on CSS for its layout. There are three DIVs: the heading, navigation bar and the main body. It turns out this is a poor design choice. On a computer using large Windows system fonts and IE6,  the fixed positioning layout of the navbar DIV resulted in its overlaying part of the body DIV and covering some text on the left hand side. Tables in the main section that are defined to use 100% of the width have also been problematical with IE6, so I've had to avoid using them. Live and learn. 

Centering was also a problem initially. The "Java Tester" title was centered within the heading DIV while the individual page titles were centered within the main body DIV. As the two DIVs have different widths, the two titles didn't line up. This is why the "Java Tester" title is now left aligned.

This web site was re-designed at the end of December 2003 and refreshed again in January 2004. The colors were tweaked again in October 2005. The heading was changed from dark green to a blended brown in May 2007.

Stats: In February 2004, I added page counters and site-wide statistics that I programmed in PHP. Initially the script and counter files lived on my personal site (and were included using IFRAMEs) because this site had low bandwidth and no PHP support. In January 2006, everything was moved to this site and the stats display was neatened up a bit. Between February 20, 2004 and March 23, 2004 this site averaged 942 page views (not hits) per day. By January 2006 the average page views/day was about 1,900 (cumulative from early 2004). 

No More Outages! Towards the end of 2005, this site was consistently going off-line at the end of each month due to its having exceeding the monthly bandwidth allowance. In December 2005 the site was moved to another hosting company with a much higher bandwidth allowance. 

On March 13, 2003, this site was added to 

 Microsoft and Java History

In December 2002 a court ruled that Microsoft must distribute the latest version of Java from Sun. In early February the ruling was set aside pending another court reviewing it. In June 2003, the higher court said Microsoft does not have to include Sun's version of Java in Windows and can not ship a Microsoft version of Java either. 

 Author

Michael Horowitz conceived, created and maintains this web site. I am a computer consultant and my personal web site has more about me and other web sites I maintain such as computergripes.com.  You can email me at  michael @ javatester.org.