Here you can find the source of deleteFile(String path)
public static void deleteFile(String path)
//package com.java2s; import java.io.File; public class Main { public static void deleteFile(String path) { File file = new File(path); if (file.exists()) { file.delete();/*from ww w . j a va 2 s . co m*/ } } public static boolean exists(String jarFilePath) { File file = new File(jarFilePath); return file.exists(); } }