title: Java program is loading from system32 folder, not from folder, which it is placed
body: <p>I wrote desktop program in Java on Windows 7 and hanged it on startup by writing to registry the path of jar file (kind of C:\Users\User\Documents\My App.jar) in <strong>HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Run</strong> branch. When my program loads with Windows, it must load some text file that placed in the same folder as the program:</p>
  
  <pre><code>File f = new File("text.txt"); // without full path to file
  if(!f.exists())
      JOptionPane.showMessageDialog(null, "File not found: " + f.getAbsolutePath());
  </code></pre>
  
  <p>but cant do it and I get message: "File not found: C:\Windows\system32\text.txt". It appears as if the program is located in the <strong>system32</strong> folder and a text file, respectively, too. What did I do wrong?</p>