For delete file in java use next lines

try{

File file = new File("c:\\myfile.txt");
file.delete()
}catch(IOException e){
e.printStackTrace();
}

Method File.delete() – returns true or false, depends on result.