I've followed an installation guide for using the Slick2D library with Netbeans, and I'm almost positive I've done everything right. But when I try to run this example code:
Code:
package SimpleGame;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
public class SimpleGame extends BasicGame{
public SimpleGame()
{
super("Slick2DPath2Glory - SimpleGame");
}
@Override
public void init(GameContainer gc)
throws SlickException {
}
@Override
public void update(GameContainer gc, int delta)
throws SlickException
{
}
public void render(GameContainer gc, Graphics g)
throws SlickException
{
}
public static void main(String[] args)
throws SlickException
{
AppGameContainer app =
new AppGameContainer(new SimpleGame());
app.setDisplayMode(800, 600, false);
app.start();
}
}
I get this error:
Code:
java.lang.NoClassDefFoundError: SimpleGame
Caused by: java.lang.ClassNotFoundException: SimpleGame
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: SimpleGame. Program will exit.
Exception in thread "main" Java Result: 1
[/code]