mopemope / meghanada-emacs

A Better Java Development Environment for Emacs
GNU General Public License v3.0
603 stars 56 forks source link

UnsatisfiedLinkError #155

Open maxandersen opened 5 years ago

maxandersen commented 5 years ago

on first start (using java 11, osx, spacemacs) I get this:

WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
[INFO ][Main      :  54] use java home: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
[INFO ][Main      :  55] use java runtime: OpenJDK Runtime Environment 11.0.4+11
[INFO ][Main      :  59] use java vm: OpenJDK 64-Bit Server VM 11.0.4+11
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/max/Library/Caches/JNA/temp/jna15306059428763411822.tmp: dlopen(/Users/max/Library/Caches/JNA/temp/jna15306059428763411822.tmp, 1): no suitable image found.  Did find:
    /Users/max/Library/Caches/JNA/temp/jna15306059428763411822.tmp: code signature in (/Users/max/Library/Caches/JNA/temp/jna15306059428763411822.tmp) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
    at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
    at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2430)
    at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2487)
    at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2684)
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2617)
    at java.base/java.lang.Runtime.load0(Runtime.java:767)
    at java.base/java.lang.System.load(System.java:1831)
    at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
    at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
    at com.sun.jna.Native.<clinit>(Native.java:195)
    at com.sun.jna.Structure.setAlignType(Structure.java:280)
    at com.sun.jna.Structure.<init>(Structure.java:197)
    at com.sun.jna.Structure.<init>(Structure.java:193)
    at com.sun.jna.Structure.<init>(Structure.java:180)
    at com.sun.jna.Structure.<init>(Structure.java:172)
    at com.sun.jna.platform.mac.SystemB$Timeval.<init>(SystemB.java:530)
    at oshi.hardware.platform.mac.MacCentralProcessor.<clinit>(MacCentralProcessor.java:58)
    at oshi.hardware.platform.mac.MacHardwareAbstractionLayer.getProcessor(MacHardwareAbstractionLayer.java:59)
    at meghanada.telemetry.TelemetryUtils.<clinit>(TelemetryUtils.java:113)
    at meghanada.Main.main(Main.java:69)
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
[INFO ][Main      :  54] use java home: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
[INFO ][Main      :  55] use java runtime: OpenJDK Runtime Environment 11.0.4+11
[INFO ][Main      :  59] use java vm: OpenJDK 64-Bit Server VM 11.0.4+11
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/max/Library/Caches/JNA/temp/jna14540805177135675622.tmp: dlopen(/Users/max/Library/Caches/JNA/temp/jna14540805177135675622.tmp, 1): no suitable image found.  Did find:
    /Users/max/Library/Caches/JNA/temp/jna14540805177135675622.tmp: code signature in (/Users/max/Library/Caches/JNA/temp/jna14540805177135675622.tmp) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
    at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
    at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2430)
    at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2487)
    at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2684)
    at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2617)
    at java.base/java.lang.Runtime.load0(Runtime.java:767)
    at java.base/java.lang.System.load(System.java:1831)
    at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1018)
    at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
    at com.sun.jna.Native.<clinit>(Native.java:195)
    at com.sun.jna.Structure.setAlignType(Structure.java:280)
    at com.sun.jna.Structure.<init>(Structure.java:197)
    at com.sun.jna.Structure.<init>(Structure.java:193)
    at com.sun.jna.Structure.<init>(Structure.java:180)
    at com.sun.jna.Structure.<init>(Structure.java:172)
    at com.sun.jna.platform.mac.SystemB$Timeval.<init>(SystemB.java:530)
    at oshi.hardware.platform.mac.MacCentralProcessor.<clinit>(MacCentralProcessor.java:58)
    at oshi.hardware.platform.mac.MacHardwareAbstractionLayer.getProcessor(MacHardwareAbstractionLayer.java:59)
    at meghanada.telemetry.TelemetryUtils.<clinit>(TelemetryUtils.java:113)
    at meghanada.Main.main(Main.java:69)
sekaiser commented 4 years ago

I experience the same issue using OpenJDK 64-Bit Server VM 12.0.2+10 on MacOS. I believe the issue is related to/similar to https://github.com/AdoptOpenJDK/openjdk-build/issues/1211.

When I changed the JDK version to 11.0.5+10 it worked.

SkyloveQiu commented 4 years ago

Switch jdk to 12.0.1 should fix it