From my Java program I have to delete a file.
How to delete file in Java code?
Hi, Java API provides methods for deleting a file in Java.
You can use the delete() method of the file class.
Here is one code example:
Check complete example code at How to delete file in Java?.
Also check Java - Deleting the file or Directory.