Why is this an issue?

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

Noncompliant code example

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