title: Java can't find file after I've exported as a jar
body: <p>In order to load up a world in my game, my program reads off of a text file. Everything works fine in Eclipse but after exporting as a runnable jar, it can no longer find the text file.</p>
  
  <p>This calls the function to read from the text file.</p>
  
  <pre><code>LevelHandler.loadLevel("res/levels/level.txt");
  </code></pre>
  
  <p>and this is the function itself</p>
  
  <pre><code>    public static void loadLevel(String file){
      String level = LevelLoader.loadFileAsString(file);
  </code></pre>
  
  <p>and this is the loadFileAsString() function</p>
  
  <pre><code>public static String loadFileAsString(String file){
      StringBuilder builder = new StringBuilder();
      try {
          @SuppressWarnings("resource")
          BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
          String line;
          while((line = bufferedReader.readLine()) != null){
              builder.append(line + "\n");
          }
      } catch (IOException e) {
          e.printStackTrace();
      }
      return builder.toString();
  }
  </code></pre>
  
  <p>Also, its probably worth noting that the res folder never appears in the jar but the levels folder inside does. Maybe that is what is making the file not able to be found. I  tried exporting with this but the same error came up.</p>
  
  <pre><code>LevelHandler.loadLevel("levels/level.txt");
  </code></pre>