Skip to main content
gamedev.net
🔒 Locked

[java] LWJGL Setup?

Started by sean4e May 11, 2004 at 8:39 AM 3 replies 750+ views
Original Post
sean4e
sean4e
Hello All! Sorry I am an extreme beginner, but I would really like to invest some time in learning how to develop some basic games in java. I have decided to use LWJGL but I am really struggling to set it up on my win 98se box. I would greatly appreciate it if someone could write a "how to setup LWJGL on win 98se for dummies" script for me. I looked around for the installation instruction but I was unable to find it. It is probably sitting right under my nose. Please have some patience with me. Thanks very much to anyone who spares some time on me, a newbie. Sean. :-) I don''''t suffer from insanity, I enjoy every minute of it!
I don''t suffer from insanity, I enjoy every minute of it!
Aldacron
Aldacron
The setup is the same on all Windows boxes. I run it on Win98 just fine. You need to make sure the jar file is on your classpath. For development, you can set this up easily in an IDE (such as Eclipse, JCreator, Netbeans, etc...) if you are using one. If you are using the commandline, you can either set it as an argument to javac or as an envirmoment variable in autoexec.bat (search Google for details).

When running LWJGL apps you also need the jar on the classpath, but if the jar is in the same directory as the app that should be enough. Also the VM needs to know the location of the lwjgl DLL. There's three ways to do this, the least troublesome of which is to use the java or javaw command line switch -Djava.library.path=.

[edited by - aldacron on May 11, 2004 10:36:08 AM]
sean4e
sean4e
Thanks alot!

So is that the only requirement for me to be able to use LWJGL? The jar file just needs to be in the classpath? Don't I need to put *.dll files anywhere or something else? **** - Ignore that, as soon as I posted this I noticed that your edited first post answers this question.

So let me see if I have this right. I first have to move and/or set the lwjgl jar file into my classpath. Then I run 'java -Djava.library.path=.' so that java knows where the lwjgl.dll file is. Then I will be able to compile and run a lwjgl project?

Thanks;
Sean.
-----------------------------

I don''t suffer from insanity, I enjoy every minute of it!

[edited by - sean4e on May 12, 2004 3:07:58 AM]
I don''t suffer from insanity, I enjoy every minute of it!
princec
princec
Not quite:

To compile a LWJGL project, you need to be able to see the LWJGL jar file as well as your own class and source files. This means the lwjgl.jar needs to be on the compile class path, along with all your classes. How this is done exactly depends on your IDE.

To run a LWJGL project, you need to be able to see the LWJGL jar file, your own classes, and you need to point the JVM at the lwjgl.dll or lwjgl.so : and the way to do this is to pass a runtime property to the JVM when you run your game which points at the directory containing the dlls. Typically you want the dlls and jars all in the same spot, so . (dot) is the best path to use - in particular if you deploy your code with Webstart, as this is the only way to make it work

Example:

java -Djava.library.path=. -cp lwjgl.jar;mygame.jar Game


Cas
sean4e
sean4e
Enkosi Kakhule !!!
(THANK YOU VERY MUCH!!!)

Sean.
----------------

I don''''t suffer from insanity, I enjoy every minute of it!
I don''t suffer from insanity, I enjoy every minute of it!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.