Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find lwjgl.dll for Windows when using Netbeans distibution #587

Closed
theosib opened this issue Sep 11, 2020 · 2 comments
Closed

Can't find lwjgl.dll for Windows when using Netbeans distibution #587

theosib opened this issue Sep 11, 2020 · 2 comments

Comments

@theosib
Copy link

theosib commented Sep 11, 2020

Environment

  • LWJGL version: 3.2.3
  • LWJGL build #: 13
  • Java version: java.version
  • Platform: macOS|Windows

Description

I am using Netbeans to build an LWJGL project. The program runs fine on Mac, but when I try to run it on Windows (java -Dorg.lwjgl.util.Debug=true -Dorg.lwjgl.util.DebugLoader=true -jar RevuePlayer2.jar), I get this error:

[LWJGL] Version: 3.2.3 build 13
[LWJGL]          OS: Windows 10 v10.0
[LWJGL]         JRE: 1.8.0_261 x86
[LWJGL]         JVM: Java HotSpot(TM) Client VM v25.261-b12 by Oracle Corporation
[LWJGL] Loading JNI library: lwjgl
[LWJGL]         Module: org.lwjgl
[LWJGL]         windows/x86/org/lwjgl/lwjgl.dll not found in java.library.path=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Python27;C:\Program Files\TortoiseSVN\bin;c:\Shortcuts;c:\Python27\Scripts;;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\PuTTY\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\tim\AppData\Local\Microsoft\WindowsApps;;.
[LWJGL]         lwjgl.dll not found in java.library.path
[LWJGL] Failed to load a library. Possible solutions:
        a) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.
        b) Add the JAR that contains the shared library to the classpath.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Failed to locate library: lwjgl.dll
        at org.lwjgl.system.Library.loadSystem(Library.java:162)
        at org.lwjgl.system.Library.loadSystem(Library.java:62)
        at org.lwjgl.system.Library.<clinit>(Library.java:50)
        at org.lwjgl.glfw.GLFW.<clinit>(GLFW.java:674)
        at revueplayer2.GraphicsWindow.setup(GraphicsWindow.java:126)
        at revueplayer2.PlayerWindow.setup(PlayerWindow.java:33)
        at revueplayer2.RevuePlayer2.main(RevuePlayer2.java:28)

As far as I can see, the right natives jars are included:

Teotihuacan:dist millerti$ ls
README.TXT       RevuePlayer2.jar lib
Teotihuacan:dist millerti$ ls lib/
RevueMedia2.jar                  lwjgl-glfw-natives-windows.jar   lwjgl-natives-macos.jar          lwjgl-opengl-natives-macos.jar   lwjgl-opengl.jar                 revue_lib-1.0-SNAPSHOT.jar
lwjgl-glfw-natives-macos.jar     lwjgl-glfw.jar                   lwjgl-natives-windows.jar        lwjgl-opengl-natives-windows.jar lwjgl.jar

Being a netbeans project, the manifest is what specifies the classpath, and here are the contents of META-INF/MANIFEST.MF:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.10.4
Created-By: 11.0.4+10-LTS (Oracle Corporation)
Class-Path: lib/lwjgl-glfw-natives-macos.jar lib/lwjgl-glfw.jar lib/lw
 jgl-natives-macos.jar lib/lwjgl.jar lib/lwjgl-opengl-natives-macos.ja
 r lib/lwjgl-opengl.jar lib/RevueMedia2.jar lib/revue_lib-1.0-SNAPSHOT
 .jar lib/lwjgl-glfw-natives-windows.jar lib/lwjgl-natives-windows.jar
  lib/lwjgl-opengl-natives-windows.jar
X-COMMENT: Main-Class will be added automatically by build
Main-Class: revueplayer2.RevuePlayer2
@theosib
Copy link
Author

theosib commented Sep 11, 2020

Turns out among the various things that my sysadmin did to mess up my PC was to remove the paths to newer Java releases. As a result, I was running a 32-bit java 8. My recommendation here would be to have the error message be explicit about the fact that there is a mismatch between the architecture of the JVM and that of the DLLs in the jars.

@Spasi
Copy link
Member

Spasi commented Sep 13, 2020

Hey @theosib, thanks for the suggestion!

Starting from the next snapshot, LWJGL will try to detect platform/architecture mismatches and will print something like this when it can't resolve a native library:

[LWJGL] Platform/architecture mismatch detected for module: org.lwjgl.opengl
        JVM platform:
                Windows x86 1.8.0_222
                OpenJDK Client VM v25.222-b10 by Azul Systems, Inc.
        Platforms available on classpath:
                windows/x64
                linux/x64
                linux/arm32
                linux/arm64
                macos/x64

theofficialgman pushed a commit to theofficialgman/lwjgl3 that referenced this issue Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants