LWJGL Forum

Please login or register.

Login with username, password and session length

Author Topic: Getting an UnsatisfiedLinkError after migrating my project to Maven  (Read 798 times)

Shlx

  • Newbie
  • *
  • Offline Offline
  • Posts: 3

Hi,

a few days ago, I tried to migrate my LWJGL project to Maven. Even after using the .pom file from the website, I keep getting an UnsatisfiedLinkError:

java.lang.UnsatisfiedLinkError: org.lwjgl.system.MemoryAccessJNI.malloc()J
   at org.lwjgl.system.MemoryAccessJNI.malloc(Native Method)
   at org.lwjgl.system.MemoryAccessJNI.<clinit>(MemoryAccessJNI.java:29)
   at org.lwjgl.system.Pointer.<clinit>(Pointer.java:22)
   at org.lwjgl.system.MemoryAccess$MemoryAccessorUnsafe.getAddressOffset(MemoryAccess.java:162)
   at org.lwjgl.system.MemoryAccess$MemoryAccessorUnsafe.<clinit>(MemoryAccess.java:153)
   at org.lwjgl.system.MemoryAccess.getInstance(MemoryAccess.java:30)
   at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:58)
   at org.lwjgl.system.MemoryStack.<init>(MemoryStack.java:59)
   at org.lwjgl.system.MemoryStack.create(MemoryStack.java:78)
   at org.lwjgl.system.MemoryStack.create(MemoryStack.java:69)
   at java.lang.ThreadLocal$SuppliedThreadLocal.initialValue(Unknown Source)
   at java.lang.ThreadLocal.setInitialValue(Unknown Source)
   at java.lang.ThreadLocal.get(Unknown Source)
   at org.lwjgl.system.MemoryStack.stackGet(MemoryStack.java:594)
   at org.lwjgl.system.MemoryStack.stackPush(MemoryStack.java:603)
   at org.lwjgl.system.Callback.<clinit>(Callback.java:35)
   at logic.Game.init(Game.java:86)
   at logic.Game.run(Game.java:71)
   at logic.Game.main(Game.java:302)
[LWJGL] [MemoryAccessor] Unsupported JVM detected, this will likely result in low performance. Please inform LWJGL developers.
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.system.Pointer
   at org.lwjgl.system.MemoryStack.mallocPointer(MemoryStack.java:477)
   at org.lwjgl.system.Callback.<clinit>(Callback.java:50)
   at logic.Game.init(Game.java:86)
   at logic.Game.run(Game.java:71)
   at logic.Game.main(Game.java:302)


Now to my understanding this means my native libraries are missing. Shouldn't this dependency in my .pom take care of that?:

    <dependency>
      <groupId>org.lwjgl</groupId>
      <artifactId>lwjgl-lmdb</artifactId>
      <version>3.1.1</version>
      <classifier>natives-windows</classifier>
      <scope>runtime</scope>
    </dependency>


What can I do to fix this?

Here's my full .pom for reference.

I'm on Windows 7, using Eclipse.

Logged

Kai

  • Guest
Re: Getting an UnsatisfiedLinkError after migrating my project to Maven
« Reply #1 on: February 18, 2017, 14:23:54 »

Please run with -Dorg.lwjgl.util.Debug=true and -Dorg.lwjgl.util.DebugLoader=true and paste the syserr output.
See this for more information: https://github.com/LWJGL/lwjgl3-wiki/wiki/2.5.-Troubleshooting#debug-mode
Logged

Shlx

  • Newbie
  • *
  • Offline Offline
  • Posts: 3
Re: Getting an UnsatisfiedLinkError after migrating my project to Maven
« Reply #2 on: February 18, 2017, 14:55:19 »

Here you go:

[LWJGL] Version: 3.1.1 build 16
[LWJGL]     OS: Windows 7 v6.1
[LWJGL]    JRE: 1.8.0_71 amd64
[LWJGL]    JVM: Java HotSpot(TM) 64-Bit Server VM v25.71-b15 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL]    Using SharedLibraryLoader...
java.lang.RuntimeException:    Failed to extract lwjgl library
   at org.lwjgl.system.SharedLibraryLoader.load(SharedLibraryLoader.java:60)
   at org.lwjgl.system.Library.loadSystem(Library.java:95)
   at org.lwjgl.system.Library.<clinit>(Library.java:53)
   at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:56)
   at org.lwjgl.system.MemoryStack.<init>(MemoryStack.java:59)
   at org.lwjgl.system.MemoryStack.create(MemoryStack.java:78)
   at org.lwjgl.system.MemoryStack.create(MemoryStack.java:69)
   at java.lang.ThreadLocal$SuppliedThreadLocal.initialValue(Unknown Source)
   at java.lang.ThreadLocal.setInitialValue(Unknown Source)
   at java.lang.ThreadLocal.get(Unknown Source)
   at org.lwjgl.system.MemoryStack.stackGet(MemoryStack.java:594)
   at org.lwjgl.system.MemoryStack.stackPush(MemoryStack.java:603)
   at org.lwjgl.system.Callback.<clinit>(Callback.java:35)
   at logic.Game.init(Game.java:86)
   at logic.Game.run(Game.java:71)
   at logic.Game.main(Game.java:302)
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
   at java.util.zip.ZipFile.read(Native Method)
   at java.util.zip.ZipFile.access$1400(Unknown Source)
   at java.util.zip.ZipFile$ZipFileInputStream.read(Unknown Source)
   at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(Unknown Source)
   at java.util.zip.InflaterInputStream.read(Unknown Source)
   at java.io.FilterInputStream.read(Unknown Source)
   at java.io.FilterInputStream.read(Unknown Source)
   at org.lwjgl.system.SharedLibraryLoader.crc(SharedLibraryLoader.java:178)
   at org.lwjgl.system.SharedLibraryLoader.extractFile(SharedLibraryLoader.java:151)
   at org.lwjgl.system.SharedLibraryLoader.extractFile(SharedLibraryLoader.java:88)
   at org.lwjgl.system.SharedLibraryLoader.load(SharedLibraryLoader.java:38)
   ... 15 more
[LWJGL]    Loaded from java.library.path: D:\eclipse\workspace\Game\lib\natives\lwjgl.dll
[LWJGL] Failed to verify native library.
java.util.zip.ZipException: invalid LOC header (bad signature)
   at java.util.zip.ZipFile.read(Native Method)
   at java.util.zip.ZipFile.access$1400(Unknown Source)
   at java.util.zip.ZipFile$ZipFileInputStream.read(Unknown Source)
   at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(Unknown Source)
   at java.util.zip.InflaterInputStream.read(Unknown Source)
   at java.util.zip.InflaterInputStream.read(Unknown Source)
   at java.io.FilterInputStream.read(Unknown Source)
   at org.lwjgl.system.Library.getSHA1(Library.java:339)
   at org.lwjgl.system.Library.checkHash(Library.java:320)
   at org.lwjgl.system.Library.loadSystem(Library.java:114)
   at org.lwjgl.system.Library.<clinit>(Library.java:53)
   at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:56)
   at org.lwjgl.system.MemoryStack.<init>(MemoryStack.java:59)
   at org.lwjgl.system.MemoryStack.create(MemoryStack.java:78)
   at org.lwjgl.system.MemoryStack.create(MemoryStack.java:69)
   at java.lang.ThreadLocal$SuppliedThreadLocal.initialValue(Unknown Source)
   at java.lang.ThreadLocal.setInitialValue(Unknown Source)
   at java.lang.ThreadLocal.get(Unknown Source)
   at org.lwjgl.system.MemoryStack.stackGet(MemoryStack.java:594)
   at org.lwjgl.system.MemoryStack.stackPush(MemoryStack.java:603)
   at org.lwjgl.system.Callback.<clinit>(Callback.java:35)
   at logic.Game.init(Game.java:86)
   at logic.Game.run(Game.java:71)
   at logic.Game.main(Game.java:302)
java.lang.UnsatisfiedLinkError: org.lwjgl.system.MemoryAccessJNI.malloc()J
   at org.lwjgl.system.MemoryAccessJNI.malloc(Native Method)
   at org.lwjgl.system.MemoryAccessJNI.<clinit>(MemoryAccessJNI.java:29)
   at org.lwjgl.system.Pointer.<clinit>(Pointer.java:22)
   at org.lwjgl.system.MemoryAccess$MemoryAccessorUnsafe.getAddressOffset(MemoryAccess.java:162)
   at org.lwjgl.system.MemoryAccess$MemoryAccessorUnsafe.<clinit>(MemoryAccess.java:153)
   at org.lwjgl.system.MemoryAccess.getInstance(MemoryAccess.java:30)
   at org.lwjgl.system.MemoryUtil.<clinit>(MemoryUtil.java:58)
   at org.lwjgl.system.MemoryStack.<init>(MemoryStack.java:59)
   at org.lwjgl.system.MemoryStack.create(MemoryStack.java:78)
   at org.lwjgl.system.MemoryStack.create(MemoryStack.java:69)
   at java.lang.ThreadLocal$SuppliedThreadLocal.initialValue(Unknown Source)
   at java.lang.ThreadLocal.setInitialValue(Unknown Source)
   at java.lang.ThreadLocal.get(Unknown Source)
   at org.lwjgl.system.MemoryStack.stackGet(MemoryStack.java:594)
   at org.lwjgl.system.MemoryStack.stackPush(MemoryStack.java:603)
   at org.lwjgl.system.Callback.<clinit>(Callback.java:35)
   at logic.Game.init(Game.java:86)
   at logic.Game.run(Game.java:71)
   at logic.Game.main(Game.java:302)
[LWJGL] [MemoryAccessor] Unsupported JVM detected, this will likely result in low performance. Please inform LWJGL developers.
[LWJGL] MemoryUtil accessor: MemoryAccessorJNI
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.system.Pointer
   at org.lwjgl.system.MemoryStack.mallocPointer(MemoryStack.java:477)
   at org.lwjgl.system.Callback.<clinit>(Callback.java:50)
   at logic.Game.init(Game.java:86)
   at logic.Game.run(Game.java:71)
   at logic.Game.main(Game.java:302)

I hope this is what you meant
Logged

spasi

  • Administrator
  • Nerdus Imperius
  • *****
  • Offline Offline
  • Posts: 1908
Re: Getting an UnsatisfiedLinkError after migrating my project to Maven
« Reply #3 on: February 18, 2017, 16:32:25 »

A corrupt download maybe? Try cleaning your .m2 cache.
Logged

Shlx

  • Newbie
  • *
  • Offline Offline
  • Posts: 3
Re: Getting an UnsatisfiedLinkError after migrating my project to Maven
« Reply #4 on: February 18, 2017, 23:01:46 »

... that actually did it - wow. Thanks a lot!
Logged