Building/Running Game.java in Eclipse 3.0

Started by Liquidream, September 01, 2004, 20:03:11

Previous topic - Next topic

Liquidream

Hi all,

Sorry I am a complete noob at LWJGL here and I can't (like most noobs!) see what I am doing wrong.  I have downloaded v0.9a from the site, ran the "test" java.jar from commandline - all seems ok.

I then followed the tutorial for creating a new project in Eclipse (I'm using 3.0 on WinXP) and still good so far... but! When I copy and paste the code for either of the two Game.java demo examples on the site I get import errors (note that I have done the step where I add "lwjgl.jar" as an external jar to the build path).

The following imports cannot be resolved  :? :
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.util.vector.Vector2f;

Which is no doubt why I have tons of other errors further down.  Upon inspection of the "lwjgl.jar" file, I cannot find the classes in the structure that the imports refer to, is this the problem?

Please can somebody take pity on me and show me what I'm doing wrong - I've no doubt it's something really silly, but it's doin' my head in.  I've had a good rummage round these forums but no joy.

Thanks v. much in advance  :cry: ,

Paul.

Liquidream

I am still trying to crack this one and I noticed (probably very obvious!), if I place "lwjgl.jar" in the project root folder (and then update the build path project properties), then it seems to solve the missing "import org.lwjgl.LWJGLException" - but the others still can't be found.

They don't seem to be in the JAR file, and I can't see any other JAR files to download from the main site.  There is a Display class in the package "org.lwjgl", but when I change "import org.lwjgl.opengl.Display;" to "import org.lwjgl.Display;" it doesn't like it (and rightly so I feel!).

Please can someone put me out of my misery and tell me how to solve this (almost cetainly) stupid/simple problem. I'm lost. Nobody else on the forums seems to have this prob. so it's gotta be something simple!?

Pathetically yours,

Paul.

kevglass

I think you've got a versioning problem. The lwjgl.jar is probably for version 0.9. Which used the Window and not Display. However, the latest code uses Display which has just been implemented.

You can either build your own lwjgl.jar out of source or wait for version 0.92 to be released (which is apparantly imminent).

Kev

Liquidream

Thanks very much - that makes sense.  Thought it was something silly!  :roll:

griff

if that doesn't work, make sure that the lwjgl.dll is in jour WINDOWS (or WINNT or WINDOWS/System32 or WINNT/System32) folder...

... that was a problem we had in the beginning :)

Matzon

!
the best way to install lwjgl on *any* computer, is to place the jar and dll's in a known application dir (not jre\ext or windows or windows\system{32}) and then *always* access it using -classpath path\to\jar and -Djava.library.path=path\to\dll.

Anything else *will* give you headaches later on.

griff

ok thnx :) my fault.

does that also work on linux e.g.:

-Djava.library.path=$LWJGL_DIR/

where $LWJGL_DIR contains the directory containing:
liblwjgl.so and
libopenal.so

??

Liquidream

Thanx for all the tips, got it kicking!  :D

(It was coz I was using old build 0.9a of .jar to try and run Demo code, a more recent build solved it!)

I also had a lot of fun  :twisted:  trying to get SpaceInvader demo to run, coz I couldn't suss where it wanted the resource files.  Got there in the end though!

Thanks again :D ,

Paul.