Error!!!

0 Bob The Zealot · April 12, 2015
I was watching:

This is my code. I named Game.java into Main.java.

Main.java:
package myGame;

import org.newdawn.slick.*;
import org.newdawn.slick.state.*;

public class Main extends StateBasedGame{

public static final String gameName = "Game";
public static final int menu = 0;
public static final int play = 0;

public Main(String gameName){
super(gameName);
this.addState(new Menu(menu));
this.addState(new Play(play));
}

public void initStatesList(GameContainer gc) throws SlickException{
this.getState(menu).init(gc, this);
this.getState(play).init(gc, this);
this.enterState(menu);
}

public static void main(String[] args) {
AppGameContainer agc;
try{
agc = new AppGameContainer(new Main(gameName));
agc.setDisplayMode(1000, 700, false);
agc.start();
}catch(SlickException e){
e.printStackTrace();
}
}
}

Menu.java:
package myGame;

import org.newdawn.slick.*;
import org.newdawn.slick.state.*;

public class Menu extends BasicGameState{

public Menu(int state){

}

public void init(GameContainer gc, StateBasedGame sbg) throws SlickException{

}

public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException{

}

public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException{

}

public int getID(){
return 0;
}
}

Play.java:

package myGame;

import org.newdawn.slick.*;
import org.newdawn.slick.state.*;

public class Play extends BasicGameState{

public Play(int state){

}

public void init(GameContainer gc, StateBasedGame sbg) throws SlickException{

}

public void render(GameContainer gc, StateBasedGame sbg, Graphics g) throws SlickException{

}

public void update(GameContainer gc, StateBasedGame sbg, int delta) throws SlickException{

}

public int getID(){
return 1;
}
}


I'm getting this error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException
at myGame.Main.main(Main.java:27)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.LWJGLException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more


Post a Reply

Replies

Oldest  Newest  Rating
0 Eyeshield Rosalin · April 12, 2015
Try to download the lwjgl 2.9.3 and use it, Hope it works
  • 1

Java / Android Development

106,912 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator