title: Java Runnable Jar IllegalArgumentException
body: <p>So I'm somewhat new to java and i'm creating a simple game with a friend of mine. I've reached a point where I want to release a jar file of it so people can play it. I exported a jar of the project in Eclipse with no problems. But when I run it, it just creates the JFrame and not the game. I CAN run it in eclipse with no issues but outside it doesn't work. I created a .bat file to launch the jar and found an error on the console:</p>
  
  <pre><code>Exception in thread "Thread-2" java.lang.IllegalArgumentException: input == null!
  at javax.imageio.ImageIO.read&lt;ImageIO.java:1388&gt;
  at images.ImageLoader.load&lt;ImageLoader.java:10&gt;
  at main.base.init&lt;base.java:37&gt;
  at main.base.run&lt;base.java:73&gt;
  at java.lang.Thread.run&lt;Thread.java:745&gt;
  </code></pre>
  
  <p>I did check the manifest and it had the right main class set. So I'm out of ideas here...
  Here's the code to my main file:</p>
  
  <pre><code>package main;
  
  import images.ImageLoader;
  import images.ImageManager;
  import images.SpriteSheet;
  import java.awt.Canvas;
  import java.awt.Dimension;
  import java.awt.Graphics;
  import java.awt.image.BufferStrategy;
  import java.awt.image.BufferedImage;
  import javax.swing.JFrame;
  
  public class base extends Canvas implements Runnable{
      //CREDIT: Thanks to CodeNMore for some base code for the game
      private static final long serialVersionUID = 1L;
      public static final int WIDTH = 484, HEIGHT = 365, SCALE = 2, TILESIZE = 24; //484, 365, scale=2
      public static boolean running = false;
      public Thread gameThread;
      private BufferedImage spriteSheet;
      private static BufferedImage cl;
      public static BufferedImage console;
      private static ImageManager im;
      private static Player player;
      private static Level level;
      private String Level[] = {"/level1.png","/level2.png","/level3.png"};
      public static String currentLevel;
  
      private static HUDLoader hud;
  
      public void init(){
          ImageLoader loader = new ImageLoader();
  
          spriteSheet = loader.load("/spritesheet.png");
          SpriteSheet ss = new SpriteSheet(spriteSheet);
          im = new ImageManager(ss);
          player = new Player(im);
  
          console = loader.load("/console.png");
          hud = new HUDLoader(console);
  
          this.addKeyListener(new KeyManager());
  
          setLevel(Level[2]);
          cl = loader.load(currentLevel);
          level = new Level(cl);
      }
  
      public static BufferedImage getLevel(){
          return cl;
      }
  
      public void setLevel(String set){
          currentLevel = set;
      }
  
      public synchronized void start(){
          if(running)return;
  
          running = true;
          gameThread = new Thread(this);
          gameThread.start();
      }
  
      public synchronized void stop(){
          if(!running)return;
  
          running = false;
          try {
              gameThread.join();
          } catch (InterruptedException e) {e.printStackTrace();}
      }
  
      public void run(){
          init();
          long lastTime = System.nanoTime();
          final double amountOfTicks = 60D;
          double ns = 1000000000 / amountOfTicks;
          double delta = 0;
  
          while(running){
              long now = System.nanoTime();
              delta += (now - lastTime) / ns;
              lastTime = now;
              if(delta &gt;= 1){
                  tick();
                  delta--;
              }
              render();
          }
          stop();
      }
  
      public void tick(){
          player.tick();
          hud.tick();
      }
  
      public void render(){
          BufferStrategy bs = this.getBufferStrategy();
          if(bs ==  null){
              createBufferStrategy(3);
              return;
          }
          Graphics g = bs.getDrawGraphics();
          //RENDER
  
          g.fillRect(0, 0, WIDTH * SCALE, HEIGHT * SCALE);
  
          level.render(g);
          player.render(g);
          hud.render(g);
  
          //Reset Render
          g.dispose();
          bs.show();
      }
  
      public static void main(String[] args){
          base game = new base();
          game.setPreferredSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
          game.setMaximumSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
          game.setMinimumSize(new Dimension(WIDTH * SCALE, HEIGHT * SCALE));
  
          JFrame frame = new JFrame("The Legend of Taco");
          frame.setSize(WIDTH * SCALE, HEIGHT * SCALE);
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setResizable(false);
          frame.add(game);
          frame.setVisible(true);
  
          game.start();
      }
  
      public static Player getPlayer(){
          return player;
      }
  
      public static HUDLoader getHud(){
          return hud;
      }
  
      public static ImageManager getImageManager(){
          return im;
      }
  }
  </code></pre>
  
  <p>Any help is appreciated!
  ~Tom </p>