Slick Forums

Discuss the Slick 2D Library
It is currently Wed Jun 19, 2013 9:57 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Feb 23, 2011 1:47 am 
Offline

Joined: Wed Feb 23, 2011 1:44 am
Posts: 1
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]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 23, 2011 8:23 am 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1190
it's SimpleGame.SimpleGame - you need to include the package name too.

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group