Note that there are some explanatory texts on larger screens.

plurals
  1. POcan't get the classpath right
    text
    copied!<p>i'm trying to compile <a href="http://thejavablog.wordpress.com/2008/06/08/using-slick-2d-to-write-a-game/" rel="nofollow noreferrer">this</a> slick2d example (first one) but i can't get it to work. here's the code:</p> <pre><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 { } } </code></pre> <p>i've put lwjgl.jar, slick.jar and ibxm.jar in the directory as instructed. then i tried:</p> <p>javac -classpath .;<em>full path</em>\slick.jar.;<em>full path</em>\lwjgl.jar;<em>full path</em>\ibxm.jar</p> <p>then</p> <p>java WizardGame</p> <p>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.</p> <p>i've also tried</p> <p>javac -classpath .;.\slick.jar.;.\lwjgl.jar;.\ibxm.jar</p> <p>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.</p> <p>edit: i did as instructed, but now it's telling me "no lwjgl in java.library.path"</p> <p>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.</p> <p>edit 2: created the manifest with what you said, then used:</p> <p>jar cfm test.jar manifest.txt</p> <p>this created a jar file, then i used</p> <p>java -jar test.jar</p> <p>and then it told me it didn't find the definition for the class WizardGame.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload