question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Natives loading issue (with JNA?) on Win10 + Java 11

See original GitHub issue

We’ve had two user reports now with the same error on Windows 10 running the game via Java 11 resulting in the attached log entry. One user can be a fluke, two not so much. Difficulty might be in how to test any attempted fixes since we’ve only encountered two systems that trigger it, today’s instance was with Discord user oil_boi

Only idea I’ve got for something to try would be to straighten up our usage of JNA via #4146 but that’s a stab in the dark. If we do figure something out there we might want to retest this, or in the absence of an available tester able to provoke the issue close this after we’ve done something in the area with the hope that this might have been resolved - can always re-open if it triggers again later.

On a semi-related note there is https://github.com/MovingBlocks/Terasology/wiki/Troubleshooting-Developer#ldso-dl-lookup-failures where some Java 11s on Ubuntu at least can fail to load LWJGL. Highly unlikely to be related as that issue seems to be a legit problem unrelated to us, see here or there - but it does make me wonder if other JDK variants would encounter this issue or if it is again very specific to a given JDK. Hard to test though. The Java 11 we ship with the launcher has hit this failure.

PathManager being initialized. Initial code location is C:\Users\jorda\Desktop\TerasologyLauncher-windows64-4.1.1\games\DistroOmega\1099\libs\engine-3.3.0-SNAPSHOT.jar
Switched it to expected working dir: C:\Users\jorda\Desktop\TerasologyLauncher-windows64-4.1.1\games\DistroOmega\1099
installPath was null, running from IDE or headless server? Setting to: C:\Users\jorda\Desktop\TerasologyLauncher-windows64-4.1.1\games\DistroOmega\1099
Found the natives dir: C:\Users\jorda\Desktop\TerasologyLauncher-windows64-4.1.1\games\DistroOmega\1099\natives
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\jorda\AppData\Local\Temp\jna-101312778\jna3303093479537907948.dll: Can't find dependent libraries
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.load0(Unknown Source)
        at java.lang.System.load(Unknown Source)
        at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:851)
        at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:826)
        at com.sun.jna.Native.<clinit>(Native.java:140)
        at com.sun.jna.Pointer.<clinit>(Pointer.java:41)
        at com.sun.jna.Structure.<clinit>(Structure.java:2078)
        at com.sun.jna.platform.win32.KnownFolders.<clinit>(KnownFolders.java:20)
        at org.terasology.engine.paths.PathManager.useDefaultHomePath(PathManager.java:177)
        at org.terasology.engine.Terasology.handleLaunchArguments(Terasology.java:400)
        at org.terasology.engine.Terasology.main(Terasology.java:133)

The above execution was via java -jar whereas running via launcher failed quietly with something like this:

14:51:48.605 [main] INFO  o.terasology.engine.TerasologyEngine - Initializing Terasology...
14:51:48.629 [main] INFO  o.terasology.engine.TerasologyEngine - [buildNumber=2315, buildId=2315, buildTag=jenkins-Terasology-2315, buildUrl=http://jenkins.terasology.org/job/Terasology/2315/, gitBranch=develop, gitCommit=112d30ed521ae27f9d6e249c7e8be04990739e9d, dateTime=2020-09-07T04:33:26Z, displayVersion=alpha, engineVersion=3.3.0-SNAPSHOT]
14:51:48.629 [main] INFO  o.terasology.engine.TerasologyEngine - Home path: C:\Users\jorda\Saved Games\Terasology
14:51:48.630 [main] INFO  o.terasology.engine.TerasologyEngine - Install path: C:\Users\jorda\Desktop\TerasologyLauncher-windows64-4.1.1\games\DistroOmega\1099
14:51:48.630 [main] INFO  o.terasology.engine.TerasologyEngine - Java: 11.0.7 in C:\Users\jorda\Desktop\TerasologyLauncher-windows64-4.1.1\jre
14:51:48.630 [main] INFO  o.terasology.engine.TerasologyEngine - Java VM: OpenJDK 64-Bit Server VM, version: 11.0.7+10-LTS
14:51:48.630 [main] INFO  o.terasology.engine.TerasologyEngine - OS: Windows 10, arch: amd64, version: 10.0
14:51:48.630 [main] INFO  o.terasology.engine.TerasologyEngine - Max. Memory: 3572 MiB
14:51:48.631 [main] INFO  o.terasology.engine.TerasologyEngine - Processors: 4

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
DarkWeirdcommented, Sep 29, 2020

@avallesalas thx for help!

@Cervator jna uses msvc100 (microsoft visual C runtime (one of many)). There lib shipped with oracle jre 8.

AdoptJDK and Liberica JDK have msvc120+

Another windows users haven’t this problem because they have installed in system already. (Like lib for old game from installer)

Then… We must upgrade or downgrade jna(4.1.0 works) Or say to windows users install msvc100

0reactions
Cervatorcommented, Oct 3, 2020

We’ve merged a supposed fix - it doesn’t seem to break anything, but it is hard to say if it fixes the problem on unmodified systems - like @avallesalas I would ask you to test but you’ve already installed the redistributable that we now in theory shouldn’t need, so I’m not sure how to do more testing or just hope that this did the trick … 😅

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · java-native-access/jna - GitHub
Contribute to java-native-access/jna development by creating an account on GitHub. ... Improper thread detaching causes deadlock in LDR on Windows 10+.
Read more >
Invalid memory access when calling COM method of dll via jdk ...
JNA : Invalid memory access when calling COM method of dll via jdk-11 64-bit ... I am using JNA (5.9.0) to access a...
Read more >
How to Handle the UnsatisfiedLinkError Runtime Error in Java
The Java java.lang.UnsatisfiedLinkError is thrown when a program uses a native libaray but is unable to find it at runtime for some reason....
Read more >
tess4j-4.5.1 java.lang.UnsatisfiedLinkError Windows 10 64bit ...
When I try to run Tesseract.getWords() I get: java.lang.UnsatisfiedLinkError: The specified module could not be found. at com.sun.jna.Native.
Read more >
Troubleshooting | djl - Deep Java Library
You might see the error when DJL tries to load the native library for the engines, but some shared libraries are missing. Let's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found