Hello Guest

Failed to load a library! (NetBeans setup)

  • 6 Replies
  • 7339 Views
Failed to load a library! (NetBeans setup)
« on: February 21, 2017, 20:47:50 »
Hi all, I'm trying to get a basic set-up working in my NetBeans IDE.  I followed the steps on the install page, but I get the following error:

[LWJGL] Failed to load a library. Possible solutions:
   a) Set -Djava.library.path or -Dorg.lwjgl.librarypath to the directory that contains the shared libraries.
   b) Add the JAR(s) containing the shared libraries to the classpath.
[LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to locate library: lwjgl.dll
   at org.lwjgl.system.Library.loadSystem(Library.java:123)


And from there it's just a big ol' stack trace of basically my whole app, which at this point is just the HelloWorld class at the Getting Started page: https://www.lwjgl.org/guide .

I notice it says it can't find 'lwjgl.dll'.  Are DLL files special?  Do I have to do something extra for them?

I added the Java flags suggested to my project runtime properties.  Properties -> Run includes "-Djava.library.path=C:\Users\Brenden\Dev\lwjgl -Dorg.lwjgl.util.DebugLoader=true" in the VM Options text box.

However looking at the LWJGL files I downloaded (I got "everything" plus the JOML Jar) I don't see any DLL files at all.  Hmm, I'm I supposed to find that someplace special?


*

Kai

Re: Failed to load a library! (NetBeans setup)
« Reply #1 on: February 21, 2017, 21:14:54 »
I followed the steps on the install page
Can you name the site whose instructions you were following, by URL?
If it wasn't this GitHub Wiki page then I suggest you follow that.
If it was that page, then I am wondering where you got this suggestion from:
I added the Java flags suggested to my project runtime properties.  Properties -> Run includes "-Djava.library.path=C:\Users\Brenden\Dev\lwjgl -Dorg.lwjgl.util.DebugLoader=true" in the VM Options text box.

Re: Failed to load a library! (NetBeans setup)
« Reply #2 on: February 21, 2017, 21:25:41 »
I added some proper debug flags, but they didn't help much.

Hello LWJGL 3.1.1 build 16!
[LWJGL] Version: 3.1.1 build 16
[LWJGL]     OS: Windows 7 v6.1
[LWJGL]    JRE: 1.8.0_25 amd64
[LWJGL]    JVM: Java HotSpot(TM) 64-Bit Server VM v25.25-b02 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL]    lwjgl.dll not found in java.library.path
[LWJGL] Failed to load a library. Possible solutions:
   a) Set -Djava.library.path or -Dorg.lwjgl.librarypath to the directory that contains the shared libraries.
   b) Add the JAR(s) containing the shared libraries to the classpath.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to locate library: lwjgl.dll
   at org.lwjgl.system.Library.loadSystem(Library.java:123)



I downloaded the zip file from Github at https://github.com/LWJGL/lwjgl3/releases .  There is no DLL file there either that I can find (lwjgl-3.1.1.zip).

I'm still pretty stuck locating a LWJGL.DLL file!


I followed the steps on the install page
Can you name the site whose instructions you were following, by URL?
If it wasn't this GitHub Wiki page then I suggest you follow that.
If it was that page, then I am wondering where you got this suggestion from:
I added the Java flags suggested to my project runtime properties.  Properties -> Run includes "-Djava.library.path=C:\Users\Brenden\Dev\lwjgl -Dorg.lwjgl.util.DebugLoader=true" in the VM Options text box.

Those direction where in the stack trace I posted in my OP, or possibly a previous one if it detects that the flag is already set.

In other words, LWJGL gives you a helpful debugging message just before it gives up the ghost.


*

Kai

Re: Failed to load a library! (NetBeans setup)
« Reply #3 on: February 21, 2017, 21:29:36 »
Okay, let me repeat myself:
I followed the steps on the install page
Which install page? Name it by URL, please! I just want to make sure that there is no false information somewhere.
And again:
Follow the instructions on this GitHub Wiki page if you haven't already. Everything will be fine, if you do.

Re: Failed to load a library! (NetBeans setup)
« Reply #4 on: February 21, 2017, 21:37:31 »
Follow the instructions on this GitHub Wiki page if you haven't already. Everything will be fine, if you do.

Yes that's what I did.  Not working.

The only difference is that I also setup the Javadoc files in the library window, and I'm using 3.1.1 instead of 3.1.0.

*

Kai

Re: Failed to load a library! (NetBeans setup)
« Reply #5 on: February 21, 2017, 22:04:15 »
Make sure that:
- when you downloaded the zip bundle from the lwjgl site,  the checkbox "Windows" under "Natives" was selected. This should have been the case, because the script on the page detects the OS
- the downloaded zip file contains jar files whose names end with "natives-windows.jar"
- you added those jar files into the NetBeans library that you should create as part of the installation instructions
- you did not include the java.library.path jvm argument in your launch configuration
« Last Edit: February 21, 2017, 22:05:56 by Kai »

Re: Failed to load a library! (NetBeans setup)
« Reply #6 on: February 21, 2017, 22:24:32 »
Make sure that:
- when you downloaded the zip bundle from the lwjgl site,  the checkbox "Windows" under "Natives" was selected. This should have been the case, because the script on the page detects the OS
- the downloaded zip file contains jar files whose names end with "natives-windows.jar"

Yes and yes.  However it looks like I managed to miss one file when I added all of the Jar files: "lwjgl-natives-windows.jar".  (Alphabetically, it's mixed in with the lwjgl-nanovg* files, so I think that's how I missed it.)

Working now!  Thanks for being patient with me.