Hello Guest

Can't get lwjgl to work in NetBeans 6.5.1 (windows vista)

  • 9 Replies
  • 14509 Views
Hi! I added libraries in project window via add Libraries (\native\win32) but I keep getting package does not exist error (I tried to import org.lwjgl.*). What am I missing?

Re: Can't get lwjgl to work in NetBeans 6.5.1 (windows vista)
« Reply #1 on: March 17, 2009, 17:21:55 »
You don't add the natives as libraries.

1. Create a library with LWJGL jars.
 - Tools > Libraries > New Library
 - Name it LWJGL. Add the jars (lwjgl, jinput, lwgjl-util) in the classpath tab, the src directory in the source tab and the javadoc dir in the javadoc tab.
 - Click ok and close the library manager.
2. Add the library to your project.
 - Right-click project > properties > libraries > add library > LWJGL
3. Add java.library.path to run parameters.
 - In the project properties under "run" put "-Djava.library.path=C:\lwjgl\native\win32" (or wherever your LWJGL dlls are, without the "") in the "VM Options" field.
« Last Edit: March 17, 2009, 17:23:27 by Ciardhubh »

Re: Can't get lwjgl to work in NetBeans 6.5.1 (windows vista)
« Reply #2 on: March 17, 2009, 17:43:25 »
Thank you! It works now. I didn't know i had to download the source. Somebody should write a guide about this.

Re: Can't get lwjgl to work in NetBeans 6.5.1 (windows vista)
« Reply #3 on: March 17, 2009, 21:10:10 »
Thank you! It works now. I didn't know i had to download the source. Somebody should write a guide about this.

You don't need the source. It's just extremely helpful because it lets you the context menu options like "jump to declaration" and "jump to source". Javadoc isn't required either but, if given, Netbeans will display the relevant documentation, e.g. in the Strg+Space menu.

You only really need the .jars, as that's where the LWJGL classes are in; and that library path parameter so LWJGL finds the os specific native libraries during runtime.

Re: Can't get lwjgl to work in NetBeans 6.5.1 (windows vista)
« Reply #4 on: March 18, 2009, 17:19:41 »
Strange. I think I tried with the jars and VM options before but it didn't work. Must have forgotten something.

Re: Can't get lwjgl to work in NetBeans 6.5.1 (windows vista)
« Reply #5 on: September 16, 2009, 04:43:11 »
the steps are actually incomplete. here is the full stepshttp://www.gaanza.com/blog/setting-up-lwjgl-with-netbeans/ to set up lwjgl with netbeans.

Re: Can't get lwjgl to work in NetBeans 6.5.1 (windows vista)
« Reply #6 on: September 16, 2009, 07:53:34 »
the steps are actually incomplete. here is the full stepshttp://www.gaanza.com/blog/setting-up-lwjgl-with-netbeans/ to set up lwjgl with netbeans.

The steps on that site are partially redundant. They add jars directly to a project and as a library. Aside from being harder to maintain (e.g. upgrades) this adds lwjgl-util.jar twice, as well as both lwjgl.jar and lwjgl-debug.jar (which are, to my understanding, mutually exclusive) to the run and test classpath.

Re: Can't get lwjgl to work in NetBeans 6.5.1 (windows vista)
« Reply #7 on: October 13, 2009, 13:55:31 »
Now if someone knows a similar one to intelliJ 8.0 ? :(
Tried everything I can think of with pointing "-Djava.library.path", copied the .dll's to 101 places etc lol

Still no luck.. why do I always get stuck on THIS whenever I try some new library..

*

Offline Rene

  • **
  • 78
Re: Can't get lwjgl to work in NetBeans 6.5.1 (windows vista)
« Reply #8 on: October 14, 2009, 01:07:07 »
The path should be specified like:

 -Djava.library.path="C:\Dev\Lib\LWJGLNatives\windows"

or pointing to wherever you've located the libraries.

Note that you can't just copy the line above and alter it, for some strange reason you'll need to re-type the double qoutes in netbeans, or else it won't work. Netbeans uses another kind of double quotes, or something like that.

If you really can't get it to work this way, copy the natives to the project's working directory, by default the project's base directory. I really don't recommend this, as it gets messy really easy.
When I am king, they shall not have bread and shelter only, but also teachings out of books, for a full belly is little worth where the mind is starved - Mark Twain

Re: Can't get lwjgl to work in NetBeans 6.5.1 (windows vista)
« Reply #9 on: October 14, 2009, 11:55:51 »
maybe you specify a lib path with several paths, then Windows is different from the UNIX path such as java.library.path="C:\aPath\TO\Dll\;.\relative\path;" like a DOS PATH with ";" semi-colons.
unlike UNIX uses ":" colons.