Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: slick2d problem getting an error

  1. #1
    Member
    Join Date
    May 2011
    Location
    west palm beach, FL
    Posts
    189
    My Mood
    Tired
    Thanks
    41
    Thanked 11 Times in 10 Posts

    Default slick2d problem getting an error

    im running through some video tutorials on youtube with slick 2d and im running into a problem i did everything like the guy said and his runs fine but mine gives me all these

    Exception in thread "main" java.lang.NoSuchMethodError: getPointer
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary1(Unknown Source)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    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:75)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.lwjgl.Sys.doLoadLibrary(Sys.java:68)
    at org.lwjgl.Sys.loadLibrary(Sys.java:84)
    at org.lwjgl.Sys.<clinit>(Sys.java:101)
    at org.lwjgl.opengl.Display.<clinit>(Display.java:128 )
    at org.newdawn.slick.AppGameContainer$1.run(AppGameCo ntainer.java:39)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.newdawn.slick.AppGameContainer.<clinit>(AppGam eContainer.java:36)
    at javagame.Game.main(Game.java:27)


    these are my 3 files codes

    Game.java
    package javagame;
     
    import org.newdawn.slick.*;
    import org.newdawn.slick.state.*;
     
    public class Game extends StateBasedGame {
     
    	public static final String gamename = "Ham Blaster!";
    	public static final int menu = 0;
    	public static final int play = 1;
     
    	public Game(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 appgc;
    		try {
    			appgc = new AppGameContainer(new Game(gamename));
    			appgc.setDisplayMode(640, 360, false);
    			appgc.start();
    		}catch(SlickException e) {
    			e.printStackTrace();
    		}
    	}
     
    }

    Menu.java
    package javagame;
     
    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 javagame;
     
    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;
    	}
     
    }

    anyone have any idea what my problem would be?

    this is cross posted here: TheNewBoston Forum &bull; View topic - having a problem with the game dev tutorials (errors)

    thanks for any kind of help


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: slick2d problem getting an error

    Exception in thread "main" java.lang.NoSuchMethodError: getPointer
    That could mean the code was compiled with a version of the class that had the getPointer() method and was executed with a version of the class that does not have that method.
    Can you check the version of the classes?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Java Game Programming Tutorials - Slick2D library
    By worsewicked in forum Java Programming Tutorials
    Replies: 2
    Last Post: June 14th, 2013, 11:58 AM
  2. ArrayList problem, help me to find out the error!
    By jinanzhaorenbo in forum Exceptions
    Replies: 1
    Last Post: July 30th, 2012, 10:55 PM
  3. Lotto Problem logic error
    By ippo in forum What's Wrong With My Code?
    Replies: 8
    Last Post: May 10th, 2012, 10:18 AM
  4. Problem Applet Error
    By mohsendeveloper in forum Java SE APIs
    Replies: 24
    Last Post: January 19th, 2012, 04:00 PM
  5. do while syntax error problem
    By derekxec in forum What's Wrong With My Code?
    Replies: 5
    Last Post: July 1st, 2011, 06:30 PM