Hello Guest

How to get LWJGL working with netbeans

  • 4 Replies
  • 17754 Views
How to get LWJGL working with netbeans
« on: October 30, 2010, 07:54:46 »
Hello.
I just found out about this library and I would like to know how to get it working with netbeans.
I'm a bit confused from the installation page as it doesn't show how to install it with netbeans.

Re: How to get LWJGL working with netbeans
« Reply #1 on: October 30, 2010, 17:21:55 »
Quick Guide:

-Go here: http://lwjgl.org/download.php
-Click LWJGL 2.6
-Download lwjgl-2.6.zip, lwjgl-source-2.6.zip, lwjgl-docs-2.6.zip
-Extract lwjgl-2.6.zip (leave others alone)
-Open NetBeans
-Go to main menu Tools|Libraries
-Click New Library, type in LWJGL2.6 as Library Name, push OK
-Make sure you're selected on LWJGL2.6
-On classpath tab, click Add Jar/Folder, go to where you extracted lwjgl-2.6.zip, go to Jar folder
-Add lwjgl.jar, lwjgl_util.jar, and jinput.jar
-On sources tab, add lwjgl-source-2.6.zip
-On javadoc tab, add lwjgl-docs-2.6.zip
-Create a new Java application
-Right click Libraries node (or go to project properties and go to libraries section)
-Add LWJGL2.6 library
-Go to project properties, go to Run section
-In VM Options, add this (changing the path and OS appropriately):  -Djava.library.path=C:/lwjglpath/native/windows

Now everything is set up.

I'm also currently working on a NetBeans plugin, so expect to see that soon (maybe a week or sooner?).  After I'm done, I'm hoping to write a better NetBeans setup tutorial on the wiki than this lol.  If you have any problems with what I said here, let me know...

P.S. nice name haha
« Last Edit: October 30, 2010, 17:23:58 by jediTofu »
cool story, bro

Re: How to get LWJGL working with netbeans
« Reply #2 on: October 30, 2010, 17:27:11 »
Also, when you add a library, it's not like it copies the files.  So store the zip's in a place you want to store them in forever.  Maybe like "C:/LWJGL/LWJGL2.6/" or your desktop or documents or wherever...

Also, if you have spaces in your path, you'll need to put quotes:
-Djava.library.path="C:/this is spacey/native/windows"
cool story, bro

Re: How to get LWJGL working with netbeans
« Reply #3 on: October 30, 2010, 18:13:10 »
Ah thanks for the descriptive guide.
Will this plugin be able to work universally? Because I have a project that I put on my USB
and it would be nice to be able to work on it on multiple computers (IE: when I'm at home and at school).

Also can anyone link me to a tutorial for getting started on LWJGL?
I could use some code to ensure it's been installed correctly in netbeans.

Re: How to get LWJGL working with netbeans
« Reply #4 on: October 30, 2010, 18:19:21 »
Try copying and pasting the source from FullScreenWindowedTest or similar:
http://lwjgl.org/demos.php


It will be able to work on any NetBeans with the plugin installed, presumably from any location (i.e., your USB drive).
But! I'm hoping to add a feature that copies all the jars/natives to your project if you want to be able to run it without the plugin.  This would also work on other IDE's if they can run Ant scripts; heck, should just work if you have Java and Ant installed.  But this would mean that your project would be a lot bigger (having the jar's and natives inside of it).  That's why it'll be like an added-on feature.
cool story, bro