title: How to get java to recognize symbolic links under cygwin
body: <p>Here's a very simple java program to print the first line of a file:</p>
  
  <pre><code>import java.io.*
  public class test {
    public static void main(String[] args) throws IOException {
      System.out.print(new BufferedReader(new FileReader(args[0])).readLine());
    }
  }
  </code></pre>
  
  <p>When I run this program under cygwin and pass it the name of a symbolic link, it prints the contents of the symbolic link, not the target of that link:</p>
  
  <pre><code>$ echo foo &gt; testfile
  $ ln -s testfile symlink_to_testfile
  $ java test testfile
  foo
  $ java test symlink_to_testfile
  !&lt;symlink&gt; ?t e s t f i l e
  </code></pre>
  
  <p>How do I convince java to follow the symlink?  I was hoping there was something simpler than implementing the redirect myself.</p>