title: FileReader can't find XML file in the same folder
body: <p>I am currently learning JAXP, SAX, DOM, StAX, XPath and XSLT.
  And while I was testing to see how StAX works, I found myself with an error.</p>
  
  <pre><code>Exception in thread "main" java.io.FileNotFoundException: test.xml (The system cannot find the file specified)
      at java.io.FileInputStream.open0(Native Method)
      at java.io.FileInputStream.open(FileInputStream.java:195)
      at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:138)
      at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:93)
      at java.io.FileReader.&lt;init&gt;(FileReader.java:58)
      at xmltest.XMLTest.main(XMLTest.java:16)
  </code></pre>
  
  <p>It's a classic error, and I know what it means, the problem is, I don't know why is it showing up since "test.xml" and "XMLTest.java" are in the same folder/package. </p>
  
  <p>Here is the code below: </p>
  
  <p><strong><em>XMLTest.java -</em></strong></p>
  
  <pre><code>package xmltest;
  
  import java.io.FileNotFoundException;
  import java.io.FileReader;
  import java.io.Reader;
  import javax.xml.stream.XMLInputFactory;
  import javax.xml.stream.XMLStreamException;
  import javax.xml.stream.XMLStreamReader;
  
  public class XMLTest {
  
      public static void main(String[] args) throws FileNotFoundException, XMLStreamException {
  
          XMLInputFactory xmlif = XMLInputFactory.newFactory();
          Reader reader = new FileReader("test.xml");
          XMLStreamReader xmlsr = xmlif.createXMLStreamReader(reader);
  
  
          while (xmlsr.hasNext()) {
  
              switch (xmlsr.next()) {
                  case XMLStreamReader.START_ELEMENT:
                      System.out.println("START_ELEMENT");
                      System.out.println(" Qname = " + xmlsr.getName());
  
                      break;
                  case XMLStreamReader.END_ELEMENT:
                      System.out.println("END_ELEMENT");
                      System.out.println(" Qname = " + xmlsr.getName());
              }
          }
      }
  
  }
  </code></pre>
  
  <p><strong><em>test.xml -</em></strong></p>
  
  <pre><code> &lt;?xml version="1.0"?&gt;
      &lt;catalog&gt;
         &lt;book id="bk101"&gt;
            &lt;author&gt;Gambardella, Matthew&lt;/author&gt;
            &lt;title&gt;XML Developer's Guide&lt;/title&gt;
            &lt;genre&gt;Computer&lt;/genre&gt;
            &lt;price&gt;44.95&lt;/price&gt;
            &lt;publish_date&gt;2000-10-01&lt;/publish_date&gt;
            &lt;description&gt;An in-depth look at creating applications 
            with XML.&lt;/description&gt;
         &lt;/book&gt;
         &lt;book id="bk102"&gt;
            &lt;author&gt;Ralls, Kim&lt;/author&gt;
            &lt;title&gt;Midnight Rain&lt;/title&gt;
            &lt;genre&gt;Fantasy&lt;/genre&gt;
            &lt;price&gt;5.95&lt;/price&gt;
            &lt;publish_date&gt;2002-12-16&lt;/publish_date&gt;
            &lt;description&gt;A former architect battles corporate zombies, 
            an evil sorceress, and her own childhood to become queen 
            of the world.&lt;/description&gt;
         &lt;/book&gt;
         &lt;book id="bk103"&gt;
            &lt;author&gt;Corets, Eva&lt;/author&gt;
            &lt;title&gt;Maeve Ascendant&lt;/title&gt;
            &lt;genre&gt;Fantasy&lt;/genre&gt;
            &lt;price&gt;5.95&lt;/price&gt;
            &lt;publish_date&gt;2000-11-17&lt;/publish_date&gt;
            &lt;description&gt;After the collapse of a nanotechnology 
            society in England, the young survivors lay the 
            foundation for a new society.&lt;/description&gt;
         &lt;/book&gt;
         &lt;book id="bk104"&gt;
            &lt;author&gt;Corets, Eva&lt;/author&gt;
            &lt;title&gt;Oberon's Legacy&lt;/title&gt;
            &lt;genre&gt;Fantasy&lt;/genre&gt;
            &lt;price&gt;5.95&lt;/price&gt;
            &lt;publish_date&gt;2001-03-10&lt;/publish_date&gt;
            &lt;description&gt;In post-apocalypse England, the mysterious 
            agent known only as Oberon helps to create a new life 
            for the inhabitants of London. Sequel to Maeve 
            Ascendant.&lt;/description&gt;
         &lt;/book&gt;
         &lt;book id="bk105"&gt;
            &lt;author&gt;Corets, Eva&lt;/author&gt;
            &lt;title&gt;The Sundered Grail&lt;/title&gt;
            &lt;genre&gt;Fantasy&lt;/genre&gt;
            &lt;price&gt;5.95&lt;/price&gt;
            &lt;publish_date&gt;2001-09-10&lt;/publish_date&gt;
            &lt;description&gt;The two daughters of Maeve, half-sisters, 
            battle one another for control of England. Sequel to 
            Oberon's Legacy.&lt;/description&gt;
         &lt;/book&gt;
         &lt;book id="bk106"&gt;
            &lt;author&gt;Randall, Cynthia&lt;/author&gt;
            &lt;title&gt;Lover Birds&lt;/title&gt;
            &lt;genre&gt;Romance&lt;/genre&gt;
            &lt;price&gt;4.95&lt;/price&gt;
            &lt;publish_date&gt;2003-09-02&lt;/publish_date&gt;
            &lt;description&gt;When Carla meets Paul at an ornithology 
            conference, tempers fly as feathers get ruffled.&lt;/description&gt;
         &lt;/book&gt;
         &lt;book id="bk107"&gt;
            &lt;author&gt;Thurman, Paula&lt;/author&gt;
            &lt;title&gt;Splish Splash&lt;/title&gt;
            &lt;genre&gt;Romance&lt;/genre&gt;
            &lt;price&gt;4.95&lt;/price&gt;
            &lt;publish_date&gt;2004-11-02&lt;/publish_date&gt;
            &lt;description&gt;A deep sea diver finds true love twenty 
            thousand leagues beneath the sea.&lt;/description&gt;
         &lt;/book&gt;
         &lt;book id="bk108"&gt;
            &lt;author&gt;Knorr, Stefan&lt;/author&gt;
            &lt;title&gt;Creepy Crawlies&lt;/title&gt;
            &lt;genre&gt;Horror&lt;/genre&gt;
            &lt;price&gt;4.95&lt;/price&gt;
            &lt;publish_date&gt;2005-12-06&lt;/publish_date&gt;
            &lt;description&gt;An anthology of horror stories about roaches,
            centipedes, scorpions  and other insects.&lt;/description&gt;
         &lt;/book&gt;
         &lt;book id="bk109"&gt;
            &lt;author&gt;Kress, Peter&lt;/author&gt;
            &lt;title&gt;Paradox Lost&lt;/title&gt;
            &lt;genre&gt;Science Fiction&lt;/genre&gt;
            &lt;price&gt;6.95&lt;/price&gt;
            &lt;publish_date&gt;2006-11-02&lt;/publish_date&gt;
            &lt;description&gt;After an inadvertant trip through a Heisenberg
            Uncertainty Device, James Salway discovers the problems 
            of being quantum.&lt;/description&gt;
         &lt;/book&gt;
         &lt;book id="bk110"&gt;
            &lt;author&gt;O'Brien, Tim&lt;/author&gt;
            &lt;title&gt;Microsoft .NET: The Programming Bible&lt;/title&gt;
            &lt;genre&gt;Computer&lt;/genre&gt;
            &lt;price&gt;36.95&lt;/price&gt;
            &lt;publish_date&gt;2006-12-09&lt;/publish_date&gt;
            &lt;description&gt;Microsoft's .NET initiative is explored in 
            detail in this deep programmer's reference.&lt;/description&gt;
         &lt;/book&gt;
         &lt;book id="bk111"&gt;
            &lt;author&gt;O'Brien, Tim&lt;/author&gt;
            &lt;title&gt;MSXML3: A Comprehensive Guide&lt;/title&gt;
            &lt;genre&gt;Computer&lt;/genre&gt;
            &lt;price&gt;36.95&lt;/price&gt;
            &lt;publish_date&gt;2007-12-01&lt;/publish_date&gt;
            &lt;description&gt;The Microsoft MSXML3 parser is covered in 
            detail, with attention to XML DOM interfaces, XSLT processing, 
            SAX and more.&lt;/description&gt;
         &lt;/book&gt;
         &lt;book id="bk112"&gt;
            &lt;author&gt;Galos, Mike&lt;/author&gt;
            &lt;title&gt;Visual Studio 7: A Comprehensive Guide&lt;/title&gt;
            &lt;genre&gt;Computer&lt;/genre&gt;
            &lt;price&gt;49.95&lt;/price&gt;
            &lt;publish_date&gt;2008-04-16&lt;/publish_date&gt;
            &lt;description&gt;Microsoft Visual Studio 7 is explored in depth,
            looking at how Visual Basic, Visual C++, C#, and ASP+ are 
            integrated into a comprehensive development 
            environment.&lt;/description&gt;
         &lt;/book&gt;
      &lt;/catalog&gt;
  </code></pre>
  
  <p>And here's a link to the screenshot of my hierarchy: <a href="http://pasteboard.co/6FbvgJLx6.png" rel="nofollow">http://pasteboard.co/6FbvgJLx6.png</a></p>
  
  <p>Thank you in advance. :)</p>
  
  <p><strong><em>EDIT</em></strong>
  When I put the absolute path to the file, it works perfectly, but I don't want to hard-code this...</p>