Natives loading issue (with JNA?) on Win10 + Java 11
See original GitHub issueWe’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:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
@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
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 … 😅