title: LWJGL 2 Code Not Compatible with LWJGL 3 Code?
body: <p>I'm very new to using external Java libraries, and I'm starting with Slick2D which is built upon LWJGL. I wrote a simple StateBasedGame that just prints three options on a screen. It gives me an error though about some (jar?) file not being present (see below for reference).</p>
  
  <p>This reminds me of the fact that most of the tutorials I come across were made one or two years ago when LWJGL 3 hadn't come out or wasn't stable yet. This means that they were all using LWJGL 2. The problem is, that a lot of the code that I try using LWJGL 3 doesn't work with the code that was originally written in LWJGL 2. Why is this? Would it be a good idea to switch back to LWJGL 2 if I wanted to learn SLick2D? Please help because simple programs that I write don't even compile.</p>
  
  <p>Here's my code that doesn't work (at least in LWJGL 3):</p>
  
  <pre><code>import org.newdawn.slick.AppGameContainer;
  import org.newdawn.slick.GameContainer;
  import org.newdawn.slick.SlickException;
  import org.newdawn.slick.state.StateBasedGame;
  
  public class Game extends StateBasedGame {
  
      Menu menu;
  
      public Game(String title) {
          super(title);
          menu = new Menu(0);
      }
  
      public static void main(String[] args) {
          try {
              AppGameContainer agc = new AppGameContainer(new Game("Text Based"));
              agc.setDisplayMode(600, 600, false);
              agc.start();
          } catch (SlickException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
      }
  
      @Override
      public void initStatesList(GameContainer container) throws SlickException {
          System.out.println("InitStates");
          addState(new Menu(0));
          getState(menu.getID()).init(container, this);
          enterState(menu.getID());
      }
  }
  
  
  import org.newdawn.slick.Color;
  import org.newdawn.slick.GameContainer;
  import org.newdawn.slick.Graphics;
  import org.newdawn.slick.SlickException;
  import org.newdawn.slick.state.BasicGameState;
  import org.newdawn.slick.state.StateBasedGame;
  
  public class Menu extends BasicGameState {
  
      private int ID;
      private int menu;
  
      public Menu(int id) {
          this.ID = id;
      }
  
      @Override
      public void init(GameContainer container, StateBasedGame sbg) throws SlickException {
      }
  
      @Override
      public void render(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
          g.setColor(Color.white);
          g.drawString("Higher or Lower", 50, 10);
  
          g.drawString("1. Play Game", 50, 100);
          g.drawString("2. High Scores", 50, 120);
          g.drawString("3. Quit", 50, 140);
  
      }
  
      @Override
      public void update(GameContainer arg0, StateBasedGame arg1, int arg2) throws SlickException {
  
      }
  
      @Override
      public int getID() {
          return ID;
      }
  
  }
  </code></pre>
  
  <p>Here is the error:</p>
  
  <pre><code>Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path
      at java.lang.ClassLoader.loadLibrary(Unknown Source)
      at java.lang.Runtime.loadLibrary0(Unknown Source)
      at java.lang.System.loadLibrary(Unknown Source)
      at org.lwjgl.Sys$1.run(Sys.java:72)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
      at org.lwjgl.Sys.loadLibrary(Sys.java:87)
      at org.lwjgl.Sys.&lt;clinit&gt;(Sys.java:117)
      at org.lwjgl.opengl.Display.&lt;clinit&gt;(Display.java:135)
      at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:39)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.newdawn.slick.AppGameContainer.&lt;clinit&gt;(AppGameContainer.java:36)
      at Game.main(Game.java:17)
  </code></pre>