title: How to open the temporary directory in Java?
body: <p>Dear community members,</p>
  
  <p>I have a small problem with the following code. I think it should open the explorer in the C:\Users\Me\AppData\Local\Temp\ directory. However that does not work, actually nothing happens. No errors.</p>
  
  <p>I have used the following code:</p>
  
  <pre><code>import java.awt.Desktop;
  import java.io.File;
  import java.io.IOException;
  
  public class Main {
      public static void main(String[] args) {
          try {
              Desktop.getDesktop().open(File.createTempFile("abcd", ".temp").getParentFile());
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>If I replace it with a normal file, like new File("C:\"), then it does work. Can someone explain to me why it does not work?</p>
  
  <p>PS: guys I forgot to tell you I also tried it with some characters like "abcd", it still gives nothing and shows nothing!</p>