delete file in java 8 code example Example: how to delete a file in java File file = new File("filepath"); file.delete(); //Returns boolean