Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-80817

Server Does Not Start - OSHI / JNA - java.lang.UnsatisfiedLinkError

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 1.8.8
    • Minecraft 1.8.3, Minecraft 1.8.4, Minecraft 1.8.5, Minecraft 1.8.6, Minecraft 1.8.7
    • None
    • Windows 7 Professional N 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.150427-0707)
    • Community Consensus

      Some users are unable to run the server as of 1.8.3 due to an error in utilizing the OSHI library to get processor information.
      The error looks something like this:

      java.lang.UnsatisfiedLinkError: Can't obtain static newInstance method for class
      com.sun.jna.Structure
      at com.sun.jna.Native.initIDs(Native Method)
      at com.sun.jna.Native.<clinit>(Native.java:135)
      at com.sun.jna.Pointer.<clinit>(Pointer.java:42)
      at com.sun.jna.platform.win32.WinReg$HKEY.<init>(WinReg.java:32)
      at com.sun.jna.platform.win32.WinReg.<clinit>(WinReg.java:61)
      at oshi.software.os.windows.WindowsHardwareAbstractionLayer.getProcessor
      s(WindowsHardwareAbstractionLayer.java:33)
      at net.minecraft.server.SystemUtils.<clinit>(SourceFile:16)
      

      The code however is designed to prevent this error and fall back to "<unknown>", but it is incorrectly designed to catch Exception rather than Throwable (which an UnsatisfiedLinkError is). The fix is simply to widen the catch block in the file we name as SystemUtils from Exception to Throwable.

      Some additional info on this issue can be seen: https://hub.spigotmc.org/jira/browse/BUILDTOOLS-114

            dinnerbone [Mojang] Nathan Adams
            md_5 [Mod] md_5
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: