proc.getInputStream().close();
int exitCode = proc.waitFor();
if (exitCode==1) {// we'll get this error code if Java is not found
logger.println("No Java found. Downloading JDK");
JDKInstaller jdki = new JDKInstaller("jdk-6u16-oth-JPR@CDS-CDS_Developer",true);
URL jdk = jdki.locate(listener, Platform.WINDOWS, CPU.i386);
listener.getLogger().println("Installing JDK");
copyStreamAndClose(jdk.openStream(), new SmbFile(remoteRoot, "jdk.exe").getOutputStream());
String javaDir = path + "\\jdk"; // this is where we install Java to