i'm trying to compile this slick2d example (first one) but i can't get it to work. here's the code:
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;
/**
* @author panos
*/
public class WizardGame extends BasicGame
{
public WizardGame()
{
super("Wizard game");
}
public static void main(String[] arguments)
{
try
{
AppGameContainer app = new AppGameContainer(new WizardGame());
app.setDisplayMode(500, 400, false);
app.start();
}
catch (SlickException e)
{
e.printStackTrace();
}
}
@Override
public void init(GameContainer container) throws SlickException
{
}
@Override
public void update(GameContainer container, int delta) throws SlickException
{
}
public void render(GameContainer container, Graphics g) throws SlickException
{
}
}
i've put lwjgl.jar, slick.jar and ibxm.jar in the directory as instructed. then i tried:
javac -classpath .;full path\slick.jar.;full path\lwjgl.jar;full path\ibxm.jar
then
java WizardGame
but i get errors that the jar classes aren't defined, which means something must be wrong when i'm setting the classpaths. i'm not sure what i'm doing wrong though.
i've also tried
javac -classpath .;.\slick.jar.;.\lwjgl.jar;.\ibxm.jar
either way, shouldn't the jvm find out about the .jar files on its own if they're on the same directory as the source code? in my case, i've set up the 3 jars in the same directory as WizardGame.java. if i try compiling without the -classpath arguments it doesn't work though.
edit: i did as instructed, but now it's telling me "no lwjgl in java.library.path"
i examined my lwjgl.jar with winrar and saw that it contains two folders: meta-inf and org, and then inside org there is lwjgl. is it supposed to be like that? because if it is, i dunno what's wrong.
edit 2: created the manifest with what you said, then used:
jar cfm test.jar manifest.txt
this created a jar file, then i used
java -jar test.jar
and then it told me it didn't find the definition for the class WizardGame.