title: Trying to load image using ImageIO.read(class.getResource(URL)) but getResource is returning null
body: <p>I've been making a 2D game with my buddy and I've been learning a lot about some basic game dev concepts through some Youtube tutorials. One of the things I was learning about is sprites (for those that don't know, 2D images to render to the screen) and how to use them in my game. I've been using <code>ImageIO.read(this.class.getResource(pathToMySprite))</code> but it seems that <code>getResource()</code> is returning <code>null</code> for some reason.</p>
  
  <p>I've been screwing around with the path a little, adding "/" in front of it, removing "/", putting the user.dir property to see if it needed the whole path, and I'm still getting the same error.</p>
  
  <pre><code>TILE_TEXTURES(System.getProperty("user.dir") + "/textures/tile.png");
  //ENTITY_TEXTURES("/textures/entity.png");
  private BufferedImage img;
  
  private SpriteSheet(String path) {
  
  System.out.println(System.getProperty("user.dir"));
  try {
     //TODO: Fix this error, don't know what's wrong.
       img = ImageIO.read(SpriteSheet.class.getResource(path)); // error here!!!
      } catch (IOException e) {
        e.printStackTrace();
      }
   }
  
  public BufferedImage getImage() {
          return img;
  }
  </code></pre>
  
  <p>Any and all help is appreciated.
  I haven't been commenting the code (I usually do that when I get to place where I can sit back and be happy with what I've finished) but it's a pretty small class so I think you guys will be able to understand what's going on just fine.</p>
  
  <p>The folder that holds the image <strong>IS</strong> in the class path of my project.
  I've also included the error:</p>
  
  <pre><code>Exception in thread "Thread-2" java.lang.ExceptionInInitializerError
      at com.brickbattle.client.src.gui.Sprite.&lt;clinit&gt;(Sprite.java:7)
      at com.brickbattle.client.src.objs.Tile.&lt;init&gt;(Tile.java:67)
      at com.brickbattle.client.src.objs.Player.initPlayerNum(Player.java:19)
      at com.brickbattle.client.src.util.BrickBattle.init(BrickBattle.java:114)
      at com.brickbattle.client.src.util.BrickBattle.run(BrickBattle.java:85)
      at java.lang.Thread.run(Unknown Source)
  Caused by: java.lang.IllegalArgumentException: input == null! //HERE IS ERROR
      at javax.imageio.ImageIO.read(Unknown Source)
      at com.brickbattle.client.src.gui.SpriteSheet.&lt;init&gt;(SpriteSheet.java:17)
  at com.brickbattle.client.src.gui.SpriteSheet.&lt;clinit&gt;(SpriteSheet.java:8)
  </code></pre>
  
  <p><strong>Thanks again!</strong></p>