title: What does #!/usr/bin/... at the start of a file mean?
body: <p>I can do something like this in Haskell:</p>
  
  <pre><code>#!/usr/bin/runghc
  main=putStrLn "Hello World"
  </code></pre>
  
  <p>Then I can run it with <code>./hello.hs</code></p>
  
  <p>My question is, why is the first line ignored? Comments in haskell start with <code>--</code> but the first line still seems to be ignored. It even loads in ghci. The trick also works with Python and Perl.</p>
  
  <p>But when I do something similar in Java:</p>
  
  <pre><code>#!/usr/local/jdk1.6.0_13/bin/javac
  ...
  </code></pre>
  
  <p>Javac gives me a compiler error.</p>
  
  <p>So how does this work and how would I get it to work with Java?</p>
  
  <p>Thanks.</p>