Use of File.deleteOnExit() is not recommended for the following reasons:

Noncompliant Code Example

File file = new File("file.txt");
file.deleteOnExit();  // Noncompliant