Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  How to install LWJGL  (Read 652 times)
0 Members and 1 Guest are viewing this topic.
Offline lcass
« Posted 2014-01-03 14:51:11 »

So ive decided to start using LWJGL  to test some stuff out. I have never used an api before and I do not know how to install it. could someone please run over how to install it, I already have the build noted in the engines section downloaded or is there another build I should use?
Offline Mike

« JGO Spiffy Duke »


Medals: 86
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #1 - Posted 2014-01-03 14:54:50 »

Hi,

I'd recommend starting here: http://lwjgl.com/wiki/index.php?title=Main_Page#Getting_started Smiley

Mike

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline opiop65

JGO Kernel


Medals: 159
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #2 - Posted 2014-01-03 15:04:51 »

Its very easy.

1. Go to this page:
http://www.lwjgl.org/download.php
And download LWJGL (the one with the most downloads)
2. Extract the zip into a folder you will remember
3.Open Eclipse (if you aren't using Eclipse then stop reading because I don't know how to do this with any other IDE.)
3. Create your project.
4. Right click on project and select properties (or ALT+Enter)
5. Click Java Build Path on the left
6. Click Add External Jars
7. Navigate to the LWJGL folder you created and add these jars from /jars:
1  
2  
lwjgl_util.jar
lwjgl.jar

These are the two basics ones you will almost always need
8. Click the little arrow next to the lwjgl.jar and click Native library location
9. Navigate back to the LWJGL folder and go to native/your_os and hit ok

And you're done! Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline lcass
« Reply #3 - Posted 2014-01-03 15:16:57 »

Thanks this really helped.
Offline opiop65

JGO Kernel


Medals: 159
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #4 - Posted 2014-01-03 15:17:37 »

If you're talking to me, no problem Wink

Offline lcass
« Reply #5 - Posted 2014-01-03 15:42:43 »

hmm I tried using SHC's first tutorial with a basic game but I get the error
usage:
XPMFile <file>
java.lang.ArrayIndexOutOfBoundsException: 0
   at org.lwjgl.util.XPMFile.main(XPMFile.java:260)
Offline opiop65

JGO Kernel


Medals: 159
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #6 - Posted 2014-01-03 15:45:51 »

I've never seen that before, and it doesn't look like its related to LWJGL. Are you sure you set up everything correctly? Try just creating a new file with only a main method in it and print something out. Then run it. Just to make sure you set up everything correctly.

Offline Troubleshoots

JGO Knight


Medals: 36
Exp: 7-9 months


Damn maths.


« Reply #7 - Posted 2014-01-03 15:50:58 »

I think you get that error when you haven't set up the natives.
Go to eclipse, right-click project, properties, java build path, libraries, expand lwjgl.jar and lwjgl_utils.jar, click native library location, edit, and then set that to the location of the natives folder.

Why are all OpenGL tutorials written in Brainf**k?
Offline lcass
« Reply #8 - Posted 2014-01-03 15:55:29 »

C:\eclipse\LWJGL\lwjgl-master\src\native is where I have set it
Offline opiop65

JGO Kernel


Medals: 159
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #9 - Posted 2014-01-03 15:57:54 »

You need to set it to that directory but select your is also. So ../natives/windows if you're running on Windows. Simply selecting the natives folder won't work.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline lcass
« Reply #10 - Posted 2014-01-03 16:19:34 »

C:\eclipse\LWJGL\lwjgl-master\src\native\windows same error.
Im accessing the jars at C:\eclipse\LWJGL\lwjgl-master\eclipse-update\org.lwjgl
Offline lcass
« Reply #11 - Posted 2014-01-03 16:22:50 »

fixed that now im getting Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
   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:73)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
   at org.lwjgl.Sys.loadLibrary(Sys.java:82)
   at org.lwjgl.Sys.<clinit>(Sys.java:99)
   at org.lwjgl.opengl.Display.<clinit>(Display.java:130)
   at gametest.Game.<init>(Game.java:28)
   at gametest.Game.main(Game.java:21)
Offline trollwarrior1
« Reply #12 - Posted 2014-01-03 18:06:03 »

fixed that now im getting Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
   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:73)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
   at org.lwjgl.Sys.loadLibrary(Sys.java:82)
   at org.lwjgl.Sys.<clinit>(Sys.java:99)
   at org.lwjgl.opengl.Display.<clinit>(Display.java:130)
   at gametest.Game.<init>(Game.java:28)
   at gametest.Game.main(Game.java:21)


You need to add natives to your LWJGL library. You either need to add them manually, or specify the folder they are located in for you lwjgl.jar file.
Offline opiop65

JGO Kernel


Medals: 159
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #13 - Posted 2014-01-03 18:11:00 »

I don't know why you are accessing them through here:
1  
C:\eclipse\LWJGL\lwjgl-master\src\native\windows same error.

But that doesn't sound correct at all. Did you follow my steps? I told you to download LWJGL and extract it. No where in the zip I told you to download is the folder src. Don't download the src LWJGL, just download the standard LWJGL.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (24 views)
2014-11-22 12:13:56

xFryIx (69 views)
2014-11-13 12:34:49

digdugdiggy (48 views)
2014-11-12 21:11:50

digdugdiggy (42 views)
2014-11-12 21:10:15

digdugdiggy (36 views)
2014-11-12 21:09:33

kovacsa (60 views)
2014-11-07 19:57:14

TehJavaDev (64 views)
2014-11-03 22:04:50

BurntPizza (62 views)
2014-11-03 18:54:52

moogie (77 views)
2014-11-03 06:22:04

CopyableCougar4 (77 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!