Here you can find the source of delete(File classDir)
public static void delete(File classDir)
//package com.java2s; //License from project: CDDL license import java.io.File; public class Main { public static void delete(File classDir) { File[] files = classDir.listFiles(); if (files != null) { for (File f : files) { delete(f);/*from w w w . j a v a 2 s . co m*/ } } classDir.delete(); } }