UninstallJava.vbs creates a list of programs with “Java” in the name. It then uninstalls all but the most recent version. You can run it locally or against a remote computer. Update 1/18/14: This has been updated to manage post XP OS, where InstallDate2 from Win32_Product is empty. If you look at the code, I now read the creation date of the local installation package when the install date is not in WMI. I have also added filters to ensure that JavaScript and Java Auto Update are not installed, plus a variable you can set to test. This script has not been written to run against a list of machines, but could be easily modified to do that or to run locally in a SCCM package.
Update: There is a now webpage where you can do this: http://java.com/en/download/uninstallapplet.jsp