private static void writeJars() {
        // First, determine which jars have actually changed.
        for (IbiscEntry e : allClasses.values()) {
            if (e.getModified()) {
                JarInfo j = e.getJarInfo();
                if (j != null) {
                    j.setModified(true);
                }
            }
        }

        // Then, write ...
        for (int i = 0; i < jarFiles.size(); i++) {
            JarInfo ji = jarFiles.get(i);
            if (ji.getModified()) {
                String name = ji.getName();
                File temp = null;
                try {
                    File file = new File(name);
                    File canonicalDir = file.getCanonicalFile().getParentFile();
                    temp = File.createTempFile("Ibisc_", null, canonicalDir);
                    FileOutputStream out = new FileOutputStream(temp);
                    BufferedOutputStream bo = new BufferedOutputStream(out, 16384);
                    ZipOutputStream zo = new ZipOutputStream(bo);
                    zo.setMethod(ZipOutputStream.DEFLATED);
                    if (! compress) {
                        zo.setLevel(0);
                    }
                    for (Enumeration<JarEntryInfo> iitems = ji.entries(); iitems.hasMoreElements();) {
                        JarEntryInfo ient = iitems.nextElement();
                        ient.write(zo);
                    }
                    zo.close();
                    rename(file, temp, canonicalDir);
                } catch(Exception e) {
                    System.err.println("Ibisc: got exception while writing "
                            + name + ": " + e);
                    e.printStackTrace();
                    if (temp != null) {
                        temp.delete();
                    }
                    System.exit(1);
                }
                ji.setModified(false);
            }
        }
    }